openshot-audio  0.1.7
juce_MouseEvent.h
Go to the documentation of this file.
1 /*
2  ==============================================================================
3 
4  This file is part of the JUCE library.
5  Copyright (c) 2015 - ROLI Ltd.
6 
7  Permission is granted to use this software under the terms of either:
8  a) the GPL v2 (or any later version)
9  b) the Affero GPL v3
10 
11  Details of these licenses can be found at: www.gnu.org/licenses
12 
13  JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
14  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15  A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 
17  ------------------------------------------------------------------------------
18 
19  To release a closed-source product which uses JUCE, commercial licenses are
20  available: visit www.juce.com for more information.
21 
22  ==============================================================================
23 */
24 
25 #ifndef JUCE_MOUSEEVENT_H_INCLUDED
26 #define JUCE_MOUSEEVENT_H_INCLUDED
27 
28 
29 //==============================================================================
37 {
38 public:
39  //==============================================================================
60  Point<float> position,
61  ModifierKeys modifiers,
62  Component* eventComponent,
63  Component* originator,
64  Time eventTime,
65  Point<float> mouseDownPos,
66  Time mouseDownTime,
67  int numberOfClicks,
68  bool mouseWasDragged) noexcept;
69 
72 
73  //==============================================================================
83 
91  const int x;
92 
100  const int y;
101 
111 
126 
135 
138 
141 
144 
145  //==============================================================================
150  int getMouseDownX() const noexcept;
151 
156  int getMouseDownY() const noexcept;
157 
162  Point<int> getMouseDownPosition() const noexcept;
163 
172  int getDistanceFromDragStart() const noexcept;
173 
179  int getDistanceFromDragStartX() const noexcept;
180 
186  int getDistanceFromDragStartY() const noexcept;
187 
193  Point<int> getOffsetFromDragStart() const noexcept;
194 
210  bool mouseWasClicked() const noexcept;
211 
216  int getNumberOfClicks() const noexcept { return numberOfClicks; }
217 
225  int getLengthOfMousePress() const noexcept;
226 
227  //==============================================================================
235  Point<int> getPosition() const noexcept;
236 
241  int getScreenX() const;
242 
247  int getScreenY() const;
248 
253  Point<int> getScreenPosition() const;
254 
259  int getMouseDownScreenX() const;
260 
265  int getMouseDownScreenY() const;
266 
271  Point<int> getMouseDownScreenPosition() const;
272 
273  //==============================================================================
280  MouseEvent getEventRelativeTo (Component* newComponent) const noexcept;
281 
286  MouseEvent withNewPosition (Point<float> newPosition) const noexcept;
287 
292  MouseEvent withNewPosition (Point<int> newPosition) const noexcept;
293 
294  //==============================================================================
302  static void setDoubleClickTimeout (int timeOutMilliseconds) noexcept;
303 
311  static int getDoubleClickTimeout() noexcept;
312 
313 
314 private:
315  //==============================================================================
316  const Point<float> mouseDownPos;
317  const uint8 numberOfClicks, wasMovedSinceMouseDown;
318 
319  MouseEvent& operator= (const MouseEvent&);
320 };
321 
322 
323 //==============================================================================
330 {
331  //==============================================================================
339  float deltaX;
340 
348  float deltaY;
349 
354 
356  bool isSmooth;
357 
361 };
362 
363 
364 #endif // JUCE_MOUSEEVENT_H_INCLUDED
MouseInputSource source
Definition: juce_MouseEvent.h:143
const Time eventTime
Definition: juce_MouseEvent.h:137
float deltaX
Definition: juce_MouseEvent.h:339
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_Time.h:41
bool isSmooth
Definition: juce_MouseEvent.h:356
Definition: juce_ModifierKeys.h:38
Definition: juce_Point.h:39
#define JUCE_API
Definition: juce_StandardHeader.h:139
Component *const eventComponent
Definition: juce_MouseEvent.h:125
bool isReversed
Definition: juce_MouseEvent.h:353
const Time mouseDownTime
Definition: juce_MouseEvent.h:140
bool isInertial
Definition: juce_MouseEvent.h:360
Definition: juce_Component.h:33
Definition: juce_MouseEvent.h:329
Component *const originalComponent
Definition: juce_MouseEvent.h:134
const ModifierKeys mods
Definition: juce_MouseEvent.h:110
Definition: juce_MouseInputSource.h:49
const int y
Definition: juce_MouseEvent.h:100
const int x
Definition: juce_MouseEvent.h:91
float deltaY
Definition: juce_MouseEvent.h:348
const Point< float > position
Definition: juce_MouseEvent.h:82
unsigned char uint8
Definition: juce_MathsFunctions.h:43
Definition: juce_MouseEvent.h:36