openshot-audio  0.1.5
juce_MouseInputSource.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_MOUSEINPUTSOURCE_H_INCLUDED
26 #define JUCE_MOUSEINPUTSOURCE_H_INCLUDED
27 
28 
29 //==============================================================================
50 {
51 public:
52  //==============================================================================
54  MouseInputSource& operator= (const MouseInputSource&) noexcept;
56 
57  //==============================================================================
58  bool operator== (const MouseInputSource& other) const noexcept { return pimpl == other.pimpl; }
59  bool operator!= (const MouseInputSource& other) const noexcept { return pimpl != other.pimpl; }
60 
61  //==============================================================================
63  bool isMouse() const;
64 
66  bool isTouch() const;
67 
71  bool canHover() const;
72 
74  bool hasMouseWheel() const;
75 
85  int getIndex() const;
86 
88  bool isDragging() const;
89 
91  Point<float> getScreenPosition() const;
92 
96  ModifierKeys getCurrentModifiers() const;
97 
99  Component* getComponentUnderMouse() const;
100 
104  void triggerFakeMove() const;
105 
111  int getNumberOfMultipleClicks() const noexcept;
112 
114  Time getLastMouseDownTime() const noexcept;
115 
117  Point<float> getLastMouseDownPosition() const noexcept;
118 
122  bool hasMouseMovedSignificantlySincePressed() const noexcept;
123 
125  bool hasMouseCursor() const noexcept;
126 
128  void showMouseCursor (const MouseCursor& cursor);
129 
131  void hideCursor();
132 
134  void revealCursor();
135 
137  void forceMouseCursorUpdate();
138 
140  bool canDoUnboundedMovement() const noexcept;
141 
159  void enableUnboundedMouseMovement (bool isEnabled, bool keepCursorVisibleUntilOffscreen = false) const;
160 
162  bool isUnboundedMouseMovementEnabled() const;
163 
165  void setScreenPosition (Point<float> newPosition);
166 
167 private:
168  //==============================================================================
169  friend class ComponentPeer;
170  friend class Desktop;
173 
174  struct SourceList;
175 
177  void handleEvent (ComponentPeer&, Point<float>, int64 time, ModifierKeys);
178  void handleWheel (ComponentPeer&, Point<float>, int64 time, const MouseWheelDetails&);
179  void handleMagnifyGesture (ComponentPeer&, Point<float>, int64 time, float scaleFactor);
180 
181  static Point<float> getCurrentRawMousePosition();
182  static void setRawMousePosition (Point<float>);
183 
185 };
186 
187 
188 #endif // JUCE_MOUSEINPUTSOURCE_H_INCLUDED
Definition: juce_MouseCursor.h:36
#define noexcept
Definition: juce_CompilerSupport.h:141
Definition: juce_Time.h:41
Definition: juce_ModifierKeys.h:38
Definition: juce_Desktop.h:52
Definition: juce_Point.h:39
#define JUCE_API
Definition: juce_StandardHeader.h:139
Definition: juce_Component.h:33
Definition: juce_MouseEvent.h:329
long long int64
Definition: juce_MathsFunctions.h:60
Definition: juce_MouseInputSource.h:49
Definition: juce_MouseInputSource.cpp:25
Definition: juce_MouseInputSource.cpp:586
bool operator==(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:565
#define JUCE_LEAK_DETECTOR(OwnerClass)
Definition: juce_LeakedObjectDetector.h:141
bool operator!=(const var &v1, const var &v2) noexcept
Definition: juce_Variant.cpp:566
Definition: juce_ComponentPeer.h:41