casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCMotionEvent.h
Go to the documentation of this file.
1 //# PCMotionEvent.h: class which stores PixelCanvas motion event information
2 //# Copyright (C) 1993,1994,1995,1996,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef TRIALDISPLAY_PCMOTIONEVENT_H
29 #define TRIALDISPLAY_PCMOTIONEVENT_H
30 
31 #include <casa/aips.h>
33 
34 namespace casa { //# NAMESPACE CASA - BEGIN
35 
36  class PixelCanvas;
37 
38 // <summary>
39 // Class which stores PixelCanvas motion event information.
40 // </summary>
41 
42 // <use visibility=export>
43 
44 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos="">
45 // </reviewed>
46 
47 // <etymology>
48 // "PCMotionEvent" is a contraction and concatenation of "PixelCanvas",
49 // "Motion" and "Event", and describes motion events occuring on
50 // PixelCanvases.
51 // </etymology>
52 
53 // <prerequisite>
54 // <li> <linkto class=PixelCanvasEvent>PixelCanvasEvent</linkto>
55 // </prerequisite>
56 
57 // <synopsis>
58 // This class adds to the information stored in the <linkto
59 // class=PixelCanvasEvent>PixelCanvasEvent</linkto> class. It adds
60 // information describing the current position of the mouse or
61 // pointing device, and the state of the keyboard modifiers (including
62 // the mouse buttons).
63 // </synopsis>
64 
65 // <example>
66 // </example>
67 
68 // <motivation>
69 // A compact way of passing motion event information around the
70 // PixelCanvas-oriented display classes was needed, with a functional
71 // but tight and efficient interface.
72 // </motivation>
73 
74 // <thrown>
75 // None.
76 // </thrown>
77 
78 // <todo asof="1999/10/15">
79 // None.
80 // </todo>
81 
83 
84  public:
85 
86  // Constructor taking a pointer to the PixelCanvas for which the
87  // event is valid, the position of the event, and the keyboard and
88  // pointer modifiers.
90  const casacore::uInt &modifiers);
91 
92  // Destructor.
93  virtual ~PCMotionEvent();
94 
95  // The x and y pixel position of the pointer when the event occured.
96  // <group>
97  virtual casacore::Int x() const {
98  return itsX;
99  }
100  virtual casacore::Int y() const {
101  return itsY;
102  }
103  // </group>
104 
105  // Return the state of the "modifiers": this is made up of mask
106  // bits referring to various keys on the keyboard (eg. Control,
107  // Shift, etc.) and the mouse buttons.
108  virtual casacore::uInt modifiers() const {
109  return itsModifiers;
110  }
111 
112  protected:
113 
114  // (Required) default constructor.
115  PCMotionEvent();
116 
117  // (Required) copy constructor.
118  PCMotionEvent(const PCMotionEvent &other);
119 
120  // (Required) copy assignment.
121  PCMotionEvent &operator=(const PCMotionEvent &other);
122 
123  private:
124 
125  // Store the position of the event here.
127 
128  // Store the button and keyboard modifier masks here.
130 
131  };
132 
133 
134 } //# NAMESPACE CASA - END
135 
136 #endif
137 
138 
int Int
Definition: aipstype.h:50
casacore::Int itsY
virtual ~PCMotionEvent()
Destructor.
Class which stores PixelCanvas motion event information.
Definition: PCMotionEvent.h:82
casacore::uInt itsModifiers
Store the button and keyboard modifier masks here.
casacore::Int itsX
Store the position of the event here.
Base class defining interface to pixel-based output devices.
Definition: PixelCanvas.h:161
virtual casacore::Int x() const
The x and y pixel position of the pointer when the event occured.
Definition: PCMotionEvent.h:97
PCMotionEvent & operator=(const PCMotionEvent &other)
(Required) copy assignment.
PCMotionEvent()
(Required) default constructor.
virtual casacore::uInt modifiers() const
Return the state of the &quot;modifiers&quot;: this is made up of mask bits referring to various keys on the ke...
virtual casacore::Int y() const
Base class describing event information for PixelCanvases.
unsigned int uInt
Definition: aipstype.h:51