/usr/include/ignition/common1/ignition/common/MouseEvent.hh is in libignition-common-dev 1.0.1-1.
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 | /*
* Copyright (C) 2016 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef IGNITION_COMMON_MOUSEEVENT_HH_
#define IGNITION_COMMON_MOUSEEVENT_HH_
#include <memory>
#include <ignition/math/Vector2.hh>
#include <ignition/common/Export.hh>
#include <ignition/common/SuppressWarning.hh>
namespace ignition
{
namespace common
{
/// Forward declare private data
class MouseEventPrivate;
/// \class MouseEvent MouseEvent.hh ignition/common/MouseEvent.hh
/// \brief Generic description of a mouse event.
class IGNITION_COMMON_VISIBLE MouseEvent
{
/// \brief Standard mouse buttons enumeration.
public: enum MouseButton
{
/// \brief No button
NO_BUTTON = 0x0,
/// \brief Left button
LEFT = 0x1,
/// \brief Middle button
MIDDLE = 0x2,
/// \brief Right button
RIGHT = 0x4
};
/// \brief Mouse event types enumeration.
public: enum EventType
{
/// \brief No event
NO_EVENT,
/// \brief Move event
MOVE,
/// \brief Press event
PRESS,
/// \brief Release event
RELEASE,
/// \brief Scroll event
SCROLL
};
/// \brief Constructor.
public: MouseEvent();
/// \brief Copy constructor.
/// \param[in] _other Other mouse event
public: MouseEvent(const MouseEvent &_other);
/// \brief Destructor
public: virtual ~MouseEvent();
/// \brief Get mouse pointer position on the screen.
/// \return Mouse pointer position on the screen.
public: ignition::math::Vector2i Pos() const;
/// \brief Set mouse pointer position on the screen.
/// \param[in] _pos Mouse pointer position on the screen.
public: void SetPos(const ignition::math::Vector2i &_pos);
/// \brief Set mouse pointer position on the screen.
/// \param[in] _x Mouse pointer X position on the screen.
/// \param[in] _y Mouse pointer Y position on the screen.
public: void SetPos(const int _x, const int _y);
/// \brief Get the previous position.
/// \return The previous mouse position.
public: ignition::math::Vector2i PrevPos() const;
/// \brief Set the previous position.
/// \param[in] _pos Previous mouse pointer position on the screen.
public: void SetPrevPos(const ignition::math::Vector2i &_pos);
/// \brief Set the previous position.
/// \param[in] _x Previous mouse pointer X position on the screen.
/// \param[in] _y Previous mouse pointer Y position on the screen.
public: void SetPrevPos(const int _x, const int _y);
/// \brief Get the position of button press.
/// \return Screen position of a button press.
public: ignition::math::Vector2i PressPos() const;
/// \brief Set the position of button press.
/// \param[in] _pos Mouse pointer position on the screen.
public: void SetPressPos(const ignition::math::Vector2i &_pos);
/// \brief Set the position of button press.
/// \param[in] _x Mouse pointer X position on the screen.
/// \param[in] _y Mouse pointer Y position on the screen.
public: void SetPressPos(const int _x, const int _y);
/// \brief Get the scroll position.
/// \return The scroll position.
public: ignition::math::Vector2i Scroll() const;
/// \brief Set the scroll position.
/// \param[in] _scroll Scroll position.
public: void SetScroll(const ignition::math::Vector2i &_scroll);
/// \brief Set the scroll position.
/// \param[in] _x Scroll X position.
/// \param[in] _y Scroll Y position.
public: void SetScroll(const int _x, const int _y);
/// \brief Get the scaling factor.
/// \return The move scaling factor.
public: float MoveScale() const;
/// \brief Set the scaling factor.
/// \param[in] _scale The move scaling factor.
public: void SetMoveScale(const float _scale);
/// \brief Get the flag for mouse drag motion
/// \return True if dragging, usually indicating a mouse move with
/// mouse button pressed.
public: bool Dragging() const;
/// \brief Set the flag for mouse drag motion
/// \param[in] _dragging The dragging flag.
public: void SetDragging(const bool _dragging);
/// \brief Get the event type.
/// \return The EventType.
public: EventType Type() const;
/// \brief Set the event type.
/// \param[in] _type The EventType.
public: void SetType(const EventType _type) const;
/// \brief Get the button which caused this event.
/// \return The button which caused this event.
public: MouseEvent::MouseButton Button() const;
/// \brief Set the button which caused the event.
/// \param[in] _button The button which caused this event.
public: void SetButton(const MouseEvent::MouseButton _button) const;
/// \brief Get the state of the buttons when the event was generated.
/// \return The state of the buttons, which can be a bitwise
/// combination of MouseEvent::MouseButton.
public: unsigned int Buttons() const;
/// \brief Set the state of the buttons when the event was generated.
/// \param[in] _buttons The state of the buttons, which can be a bitwise
/// combination of MouseEvent::MouseButton.
public: void SetButtons(const unsigned int &_buttons);
/// \brief Get the shift key press flag.
/// \return True if the shift key is pressed.
public: bool Shift() const;
/// \brief Set the shift key press flag.
/// \param[in] _shift The shift key press flag.
public: void SetShift(const bool _shift) const;
/// \brief Get the alt key press flag.
/// \return True if the alt key is pressed.
public: bool Alt() const;
/// \brief Set the alt key press flag.
/// \param[in] _alt The alt key flag.
public: void SetAlt(const bool _alt);
/// \brief Get the control key press flag.
/// \return True if the control key is pressed.
public: bool Control() const;
/// \brief Set the control key press flag.
/// \param[in] _control The control key flag.
public: void SetControl(const bool _control) const;
/// \brief Assignment operator
/// \param[in] _other Other mouse event
/// \return this
public: MouseEvent &operator=(const MouseEvent &_other);
IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
/// \internal
/// \brief Private data pointer
private: std::unique_ptr<MouseEventPrivate> dataPtr;
IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
};
}
}
#endif
|