Panda3D
pointerEvent.h
1 // Filename: pointerEvent.h
2 // Created by: jyelon (20Sep2007)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef POINTEREVENT_H
16 #define POINTEREVENT_H
17 
18 #include "pandabase.h"
19 #include "mouseData.h"
20 
21 class Datagram;
22 class DatagramIterator;
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : PointerEvent
26 // Description : Records a pointer movement event.
27 ////////////////////////////////////////////////////////////////////
28 class EXPCL_PANDA_EVENT PointerEvent {
29 public:
30 
31  INLINE PointerEvent();
32  INLINE PointerEvent(const PointerEvent &copy);
33  INLINE void operator = (const PointerEvent &copy);
34 
35  INLINE bool operator == (const PointerEvent &other) const;
36  INLINE bool operator != (const PointerEvent &other) const;
37  INLINE bool operator < (const PointerEvent &other) const;
38 
39  void output(ostream &out) const;
40 
41  void write_datagram(Datagram &dg) const;
42  void read_datagram(DatagramIterator &scan);
43 
44 public:
45  bool _in_window;
46  int _xpos;
47  int _ypos;
48  int _dx;
49  int _dy;
50  double _length;
51  double _direction;
52  double _rotation;
53  int _sequence;
54  double _time;
55 };
56 
57 INLINE ostream &operator << (ostream &out, const PointerEvent &pe) {
58  pe.output(out);
59  return out;
60 }
61 
62 #include "pointerEvent.I"
63 
64 #endif
65 
A class to retrieve the individual data elements previously stored in a Datagram. ...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
Records a pointer movement event.
Definition: pointerEvent.h:28