File tree Expand file tree Collapse file tree 2 files changed +34
-39
lines changed Expand file tree Collapse file tree 2 files changed +34
-39
lines changed Original file line number Diff line number Diff line change 11
11
* @date 2002-07-15
12
12
*/
13
13
14
- /* *
15
- *
16
- */
17
- INLINE PointerData::
18
- PointerData () {
19
- _in_window = false ;
20
- _xpos = 0 ;
21
- _ypos = 0 ;
22
- }
23
-
24
- /* *
25
- *
26
- */
27
- INLINE PointerData::
28
- PointerData (const PointerData ©) :
29
- _in_window(copy._in_window),
30
- _xpos(copy._xpos),
31
- _ypos(copy._ypos)
32
- {
33
- }
34
-
35
- /* *
36
- *
37
- */
38
- INLINE void PointerData::
39
- operator = (const PointerData ©) {
40
- _in_window = copy._in_window ;
41
- _xpos = copy._xpos ;
42
- _ypos = copy._ypos ;
43
- }
44
-
45
14
/* *
46
15
*
47
16
*/
@@ -59,13 +28,34 @@ get_y() const {
59
28
}
60
29
61
30
/* *
62
- *
31
+ * If this returns false, the pointer is not currently present in the window
32
+ * and the values returned by get_x() and get_y() may not be meaningful.
63
33
*/
64
34
INLINE bool PointerData::
65
35
get_in_window () const {
66
36
return _in_window;
67
37
}
68
38
39
+ /* *
40
+ * Returns a unique identifier for this pointer. This is for tracking
41
+ * individual fingers. This value should not be assumed to have a specific
42
+ * meaning other than that there will not be two different pointers active
43
+ * simultaneously with the same identifier.
44
+ */
45
+ INLINE int PointerData::
46
+ get_id () const {
47
+ return _id;
48
+ }
49
+
50
+ /* *
51
+ * Returns the pressure of the pointer. For mice, this will be 1.0 if any
52
+ * button is pressed, 0.0 otherwise.
53
+ */
54
+ INLINE double PointerData::
55
+ get_pressure () const {
56
+ return _pressure;
57
+ }
58
+
69
59
70
60
INLINE std::ostream &operator << (std::ostream &out, const PointerData &md) {
71
61
md.output (out);
Original file line number Diff line number Diff line change 24
24
*/
25
25
class EXPCL_PANDA_PUTIL PointerData {
26
26
PUBLISHED:
27
- INLINE PointerData ();
28
- INLINE PointerData (const PointerData ©);
29
- INLINE void operator = (const PointerData ©);
30
-
31
27
INLINE double get_x () const ;
32
28
INLINE double get_y () const ;
33
29
INLINE bool get_in_window () const ;
34
30
31
+ public:
32
+ INLINE int get_id () const ;
33
+ INLINE double get_pressure () const ;
34
+
35
35
void output (std::ostream &out) const ;
36
36
37
+ PUBLISHED:
37
38
MAKE_PROPERTY (x, get_x);
38
39
MAKE_PROPERTY (y, get_y);
40
+ MAKE_PROPERTY (id, get_id);
39
41
MAKE_PROPERTY (in_window, get_in_window);
42
+ MAKE_PROPERTY (pressure, get_pressure);
40
43
41
44
public:
42
- bool _in_window;
43
- double _xpos;
44
- double _ypos;
45
+ bool _in_window = false ;
46
+ double _xpos = 0.0 ;
47
+ double _ypos = 0.0 ;
48
+ double _pressure = 0.0 ;
49
+ int _id = 0 ;
45
50
};
46
51
47
52
INLINE std::ostream &operator << (std::ostream &out, const PointerData &md);
You can’t perform that action at this time.
0 commit comments