#include <juce_MouseInputSourceImpl.h>


Classes | |
| struct | RecentMouseDown |
Public Types | |
| using | SH = ScalingHelpers |
Static Public Member Functions | |
| static Component * | findComponentAt (Point< float > screenPos, ComponentPeer *peer) |
Public Attributes | |
| ModifierKeys | buttonState |
| const int | index |
| const MouseInputSource::InputSourceType | inputType |
| bool | isCursorVisibleUntilOffscreen = false |
| bool | isUnboundedMouseModeOn = false |
| detail::PointerState | lastPointerState |
| Point< float > | unboundedMouseOffset |
Private Member Functions | |
| void | cancelPendingUpdate () noexcept |
| This will stop any pending updates from happening. | |
| void | handleUpdateNowIfNeeded () |
| If an update has been triggered and is pending, this will invoke it synchronously. | |
| bool | isUpdatePending () const noexcept |
| Returns true if there's an update callback in the pipeline. | |
| void | registerMouseDown (Point< float > screenPos, Time time, Component &component, const ModifierKeys modifiers, bool isTouchSource) noexcept |
| void | registerMouseDrag (Point< float > screenPos) noexcept |
| void | triggerAsyncUpdate () |
| Causes the callback to be triggered at a later time. | |
Private Attributes | |
| ReferenceCountedObjectPtr< AsyncUpdaterMessage > | activeMessage |
| WeakReference< Component > | componentUnderMouse |
| void * | currentCursorHandle = nullptr |
| WeakReference< Component > | lastNonInertialWheelTarget |
| ComponentPeer * | lastPeer = nullptr |
| Time | lastTime |
| RecentMouseDown | mouseDowns [4] |
| int | mouseEventCounter = 0 |
| bool | movedSignificantly = false |
|
inline |
|
noexceptinherited |
This will stop any pending updates from happening.
If called after triggerAsyncUpdate() and before the handleAsyncUpdate() callback happens, this will cancel the handleAsyncUpdate() callback.
Note that this method simply cancels the next callback - if a callback is already in progress on a different thread, this won't block until the callback finishes, so there's no guarantee that the callback isn't still running when the method returns.
Referenced by juce::detail::ConcreteScopedContentSharerImpl::~ConcreteScopedContentSharerImpl(), juce::detail::ConcreteScopedMessageBoxImpl::~ConcreteScopedMessageBoxImpl(), juce::OpenGLContext::NativeContext::~NativeContext(), juce::detail::ConcreteScopedContentSharerImpl::close(), juce::detail::ConcreteScopedMessageBoxImpl::close(), and setPointerState().
|
inline |
References getComponentUnderMouse(), isCursorVisibleUntilOffscreen, isDragging(), juce::Point< ValueType >::isOrigin(), isUnboundedMouseModeOn, lastPointerState, juce::detail::PointerState::position, revealCursor(), setScreenPosition(), unboundedMouseOffset, and juce::detail::ScalingHelpers::unscaledScreenPosToScaled().
Referenced by setButtons().
|
inlinestatic |
|
inlinenoexcept |
References componentUnderMouse.
Referenced by enableUnboundedMouseMovement(), getTargetForGesture(), revealCursor(), setButtons(), setComponentUnderMouse(), and setPointerState().
|
inlinenoexcept |
|
inlinenoexcept |
References mouseDowns, and juce::detail::ScalingHelpers::unscaledScreenPosToScaled().
|
inlinenoexcept |
References mouseDowns, and juce::detail::MouseInputSourceImpl::RecentMouseDown::time.
|
inlinenoexcept |
|
inlinenoexcept |
References juce::ComponentPeer::isValidPeer(), and lastPeer.
Referenced by handleEvent(), setPeer(), setPointerState(), and showMouseCursor().
|
inlineoverridevirtual |
Called back to do whatever your class needs to do.
This method is called by the message thread at the next convenient time after the triggerAsyncUpdate() method has been called.
Implements juce::AsyncUpdater.
References juce::Time::getCurrentTime(), juce::jmax(), lastPointerState, lastTime, and setPointerState().
|
inline |
References juce::MouseInputSource::defaultRotation, getPeer(), juce::ModifierKeys::isAnyMouseButtonDown(), isDragging(), lastTime, juce::ComponentPeer::localToGlobal(), mouseEventCounter, setButtons(), setPeer(), setPointerState(), juce::PenDetails::tiltX, juce::PenDetails::tiltY, juce::detail::PointerState::withOrientation(), juce::detail::PointerState::withPosition(), juce::detail::PointerState::withPressure(), juce::detail::PointerState::withRotation(), juce::detail::PointerState::withTiltX(), and juce::detail::PointerState::withTiltY().
|
inline |
References getTargetForGesture(), and sendMagnifyGesture().
|
inline |
References juce::Rectangle< ValueType >::getCentre(), juce::Component::getParentMonitorArea(), juce::Component::getScreenBounds(), isCursorVisibleUntilOffscreen, juce::Point< ValueType >::isOrigin(), lastPointerState, juce::detail::PointerState::position, juce::Rectangle< ValueType >::reduced(), juce::detail::ScalingHelpers::scaledScreenPosToUnscaled(), juce::MouseInputSource::setRawMousePosition(), setScreenPosition(), juce::Rectangle< ValueType >::toFloat(), and unboundedMouseOffset.
Referenced by setPointerState().
|
inherited |
If an update has been triggered and is pending, this will invoke it synchronously.
Use this as a kind of "flush" operation - if an update is pending, the handleAsyncUpdate() method will be called immediately; if no update is pending, then nothing will be done.
Because this may invoke the callback, this method must only be called on the main event thread.
|
inline |
|
inlinenoexcept |
References isLongPressOrDrag().
|
inlinenoexcept |
References movedSignificantly.
|
inline |
References juce::MouseCursor::NoCursor, and showMouseCursor().
|
inlinenoexcept |
References buttonState, and juce::ModifierKeys::isAnyMouseButtonDown().
Referenced by enableUnboundedMouseMovement(), handleEvent(), setButtons(), and setPointerState().
|
inlinenoexcept |
|
noexceptinherited |
Returns true if there's an update callback in the pipeline.
|
inlineprivatenoexcept |
References juce::detail::MouseInputSourceImpl::RecentMouseDown::buttons, juce::detail::MouseInputSourceImpl::RecentMouseDown::isTouch, lastNonInertialWheelTarget, mouseDowns, movedSignificantly, juce::numElementsInArray(), juce::detail::MouseInputSourceImpl::RecentMouseDown::peerID, juce::detail::MouseInputSourceImpl::RecentMouseDown::position, juce::detail::MouseInputSourceImpl::RecentMouseDown::time, and juce::ModifierKeys::withOnlyMouseButtons().
Referenced by setButtons().
|
inlineprivatenoexcept |
References juce::Point< ValueType >::getDistanceFrom(), mouseDowns, movedSignificantly, and juce::detail::MouseInputSourceImpl::RecentMouseDown::position.
Referenced by setPointerState().
|
inline |
References getComponentUnderMouse(), juce::MouseCursor::NormalCursor, and showMouseCursor().
Referenced by enableUnboundedMouseMovement(), setComponentUnderMouse(), and setPointerState().
|
inline |
References JUCE_MOUSE_EVENT_DBG, and juce::detail::ScalingHelpers::screenPosToLocalPos().
Referenced by handleMagnifyGesture().
|
inline |
|
inline |
|
inline |
References JUCE_MOUSE_EVENT_DBG, juce::detail::PointerState::position, and juce::detail::ScalingHelpers::screenPosToLocalPos().
Referenced by setComponentUnderMouse().
|
inline |
References JUCE_MOUSE_EVENT_DBG, juce::detail::PointerState::position, and juce::detail::ScalingHelpers::screenPosToLocalPos().
Referenced by setComponentUnderMouse().
|
inline |
References JUCE_MOUSE_EVENT_DBG, juce::detail::PointerState::position, and juce::detail::ScalingHelpers::screenPosToLocalPos().
Referenced by setPointerState().
|
inline |
|
inline |
References JUCE_MOUSE_EVENT_DBG, and juce::detail::ScalingHelpers::screenPosToLocalPos().
Referenced by handleWheel().
|
inline |
References buttonState, enableUnboundedMouseMovement(), getComponentUnderMouse(), getCurrentModifiers(), juce::Desktop::getInstance(), juce::Desktop::incrementMouseClickCounter(), inputType, juce::ModifierKeys::isAnyMouseButtonDown(), isDragging(), mouseEventCounter, juce::detail::PointerState::position, registerMouseDown(), sendMouseDown(), sendMouseUp(), setPointerState(), juce::MouseInputSource::touch, unboundedMouseOffset, and juce::detail::PointerState::withPositionOffset().
Referenced by handleEvent(), and setComponentUnderMouse().
|
inline |
References buttonState, componentUnderMouse, juce::WeakReference< ObjectType, ReferenceCountingType >::get(), getComponentUnderMouse(), revealCursor(), sendMouseEnter(), sendMouseExit(), and setButtons().
Referenced by setPeer(), and setPointerState().
|
inline |
References findComponentAt(), getPeer(), lastPeer, juce::detail::PointerState::position, and setComponentUnderMouse().
Referenced by getTargetForGesture(), and handleEvent().
|
inline |
References juce::AsyncUpdater::cancelPendingUpdate(), findComponentAt(), getComponentUnderMouse(), getPeer(), handleUnboundedDrag(), isDragging(), isUnboundedMouseModeOn, lastPointerState, juce::detail::PointerState::position, registerMouseDrag(), revealCursor(), sendMouseDrag(), sendMouseMove(), setComponentUnderMouse(), unboundedMouseOffset, and juce::detail::PointerState::withPositionOffset().
Referenced by getTargetForGesture(), handleAsyncUpdate(), handleEvent(), and setButtons().
References juce::detail::ScalingHelpers::scaledScreenPosToUnscaled(), and juce::MouseInputSource::setRawMousePosition().
Referenced by enableUnboundedMouseMovement(), and handleUnboundedDrag().
|
inline |
References currentCursorHandle, juce::MouseCursor::getHandle(), getPeer(), isCursorVisibleUntilOffscreen, juce::Point< ValueType >::isOrigin(), isUnboundedMouseModeOn, juce::MouseCursor::NoCursor, juce::MouseCursor::showInWindow(), and unboundedMouseOffset.
Referenced by hideCursor(), and revealCursor().
|
inherited |
Causes the callback to be triggered at a later time.
This method returns immediately, after which a callback to the handleAsyncUpdate() method will be made by the message thread as soon as possible.
If an update callback is already pending but hasn't happened yet, calling this method will have no effect.
It's thread-safe to call this method from any thread, BUT beware of calling it from a real-time (e.g. audio) thread, because it involves posting a message to the system queue, which means it may block (and in general will do on most OSes).
Referenced by juce::detail::TemporaryFilesDecorator::runAsync(), juce::OpenGLContext::NativeContext::swapBuffers(), and triggerFakeMove().
|
inline |
References juce::AsyncUpdater::triggerAsyncUpdate().
Referenced by getTargetForGesture().
|
privateinherited |
| ModifierKeys juce::detail::MouseInputSourceImpl::buttonState |
Referenced by getCurrentModifiers(), isDragging(), setButtons(), and setComponentUnderMouse().
|
private |
Referenced by getComponentUnderMouse(), and setComponentUnderMouse().
|
private |
Referenced by showMouseCursor().
| const int juce::detail::MouseInputSourceImpl::index |
| const MouseInputSource::InputSourceType juce::detail::MouseInputSourceImpl::inputType |
Referenced by getRawScreenPosition(), and setButtons().
| bool juce::detail::MouseInputSourceImpl::isCursorVisibleUntilOffscreen = false |
Referenced by enableUnboundedMouseMovement(), handleUnboundedDrag(), and showMouseCursor().
| bool juce::detail::MouseInputSourceImpl::isUnboundedMouseModeOn = false |
Referenced by enableUnboundedMouseMovement(), setPointerState(), and showMouseCursor().
|
private |
Referenced by handleWheel(), and registerMouseDown().
|
private |
| detail::PointerState juce::detail::MouseInputSourceImpl::lastPointerState |
|
private |
Referenced by getTargetForGesture(), handleAsyncUpdate(), handleEvent(), and isLongPressOrDrag().
|
private |
|
private |
Referenced by getTargetForGesture(), handleEvent(), and setButtons().
|
private |
Referenced by hasMovedSignificantlySincePressed(), isLongPressOrDrag(), registerMouseDown(), and registerMouseDrag().