JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::detail::MouseInputSourceImpl Class Reference

#include <juce_MouseInputSourceImpl.h>

Inheritance diagram for juce::detail::MouseInputSourceImpl:
Collaboration diagram for juce::detail::MouseInputSourceImpl:

Classes

struct  RecentMouseDown
 

Public Types

using SH = ScalingHelpers
 

Public Member Functions

 MouseInputSourceImpl (int i, MouseInputSource::InputSourceType type)
 
void enableUnboundedMouseMovement (bool enable, bool keepCursorVisibleUntilOffscreen)
 
ComponentgetComponentUnderMouse () const noexcept
 
ModifierKeys getCurrentModifiers () const noexcept
 
Point< floatgetLastMouseDownPosition () const noexcept
 
Time getLastMouseDownTime () const noexcept
 
int getNumberOfMultipleClicks () const noexcept
 
ComponentPeergetPeer () noexcept
 
Point< floatgetRawScreenPosition () const noexcept
 
Point< floatgetScreenPosition () const noexcept
 
ComponentgetTargetForGesture (ComponentPeer &peer, Point< float > positionWithinPeer, Time time, Point< float > &screenPos)
 
void handleAsyncUpdate () override
 Called back to do whatever your class needs to do.
 
void handleEvent (ComponentPeer &newPeer, Point< float > positionWithinPeer, Time time, const ModifierKeys newMods, float newPressure, float newOrientation, PenDetails pen)
 
void handleMagnifyGesture (ComponentPeer &peer, Point< float > positionWithinPeer, Time time, const float scaleFactor)
 
void handleUnboundedDrag (Component &current)
 
void handleWheel (ComponentPeer &peer, Point< float > positionWithinPeer, Time time, const MouseWheelDetails &wheel)
 
bool hasMouseMovedSignificantlySincePressed () const noexcept
 
bool hasMovedSignificantlySincePressed () const noexcept
 
void hideCursor ()
 
bool isDragging () const noexcept
 
bool isLongPressOrDrag () const noexcept
 
void revealCursor (bool forcedUpdate)
 
void sendMagnifyGesture (Component &comp, Point< float > screenPos, Time time, float amount)
 
void sendMouseDown (Component &comp, const detail::PointerState &pointerState, Time time)
 
void sendMouseDrag (Component &comp, const detail::PointerState &pointerState, Time time)
 
void sendMouseEnter (Component &comp, const detail::PointerState &pointerState, Time time)
 
void sendMouseExit (Component &comp, const detail::PointerState &pointerState, Time time)
 
void sendMouseMove (Component &comp, const detail::PointerState &pointerState, Time time)
 
void sendMouseUp (Component &comp, const detail::PointerState &pointerState, Time time, ModifierKeys oldMods)
 
void sendMouseWheel (Component &comp, Point< float > screenPos, Time time, const MouseWheelDetails &wheel)
 
bool setButtons (const detail::PointerState &pointerState, Time time, ModifierKeys newButtonState)
 
void setComponentUnderMouse (Component *newComponent, const detail::PointerState &pointerState, Time time)
 
void setPeer (ComponentPeer &newPeer, const detail::PointerState &pointerState, Time time)
 
void setPointerState (const detail::PointerState &newPointerState, Time time, bool forceUpdate)
 
void setScreenPosition (Point< float > p)
 
void showMouseCursor (MouseCursor cursor, bool forcedUpdate)
 
void triggerFakeMove ()
 

Static Public Member Functions

static ComponentfindComponentAt (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< floatunboundedMouseOffset
 

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< ComponentcomponentUnderMouse
 
void * currentCursorHandle = nullptr
 
WeakReference< ComponentlastNonInertialWheelTarget
 
ComponentPeerlastPeer = nullptr
 
Time lastTime
 
RecentMouseDown mouseDowns [4]
 
int mouseEventCounter = 0
 
bool movedSignificantly = false
 

Member Typedef Documentation

◆ SH

Constructor & Destructor Documentation

◆ MouseInputSourceImpl()

juce::detail::MouseInputSourceImpl::MouseInputSourceImpl ( int  i,
MouseInputSource::InputSourceType  type 
)
inline

Member Function Documentation

◆ cancelPendingUpdate()

void juce::AsyncUpdater::cancelPendingUpdate ( )
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().

◆ enableUnboundedMouseMovement()

◆ findComponentAt()

◆ getComponentUnderMouse()

Component * juce::detail::MouseInputSourceImpl::getComponentUnderMouse ( ) const
inlinenoexcept

◆ getCurrentModifiers()

ModifierKeys juce::detail::MouseInputSourceImpl::getCurrentModifiers ( ) const
inlinenoexcept

◆ getLastMouseDownPosition()

Point< float > juce::detail::MouseInputSourceImpl::getLastMouseDownPosition ( ) const
inlinenoexcept

◆ getLastMouseDownTime()

Time juce::detail::MouseInputSourceImpl::getLastMouseDownTime ( ) const
inlinenoexcept

◆ getNumberOfMultipleClicks()

int juce::detail::MouseInputSourceImpl::getNumberOfMultipleClicks ( ) const
inlinenoexcept

◆ getPeer()

ComponentPeer * juce::detail::MouseInputSourceImpl::getPeer ( )
inlinenoexcept

◆ getRawScreenPosition()

Point< float > juce::detail::MouseInputSourceImpl::getRawScreenPosition ( ) const
inlinenoexcept

◆ getScreenPosition()

Point< float > juce::detail::MouseInputSourceImpl::getScreenPosition ( ) const
inlinenoexcept

◆ getTargetForGesture()

Component * juce::detail::MouseInputSourceImpl::getTargetForGesture ( ComponentPeer peer,
Point< float positionWithinPeer,
Time  time,
Point< float > &  screenPos 
)
inline

◆ handleAsyncUpdate()

void juce::detail::MouseInputSourceImpl::handleAsyncUpdate ( )
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().

◆ handleEvent()

◆ handleMagnifyGesture()

void juce::detail::MouseInputSourceImpl::handleMagnifyGesture ( ComponentPeer peer,
Point< float positionWithinPeer,
Time  time,
const float  scaleFactor 
)
inline

◆ handleUnboundedDrag()

◆ handleUpdateNowIfNeeded()

void juce::AsyncUpdater::handleUpdateNowIfNeeded ( )
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.

◆ handleWheel()

◆ hasMouseMovedSignificantlySincePressed()

bool juce::detail::MouseInputSourceImpl::hasMouseMovedSignificantlySincePressed ( ) const
inlinenoexcept

References isLongPressOrDrag().

◆ hasMovedSignificantlySincePressed()

bool juce::detail::MouseInputSourceImpl::hasMovedSignificantlySincePressed ( ) const
inlinenoexcept

References movedSignificantly.

◆ hideCursor()

void juce::detail::MouseInputSourceImpl::hideCursor ( )
inline

◆ isDragging()

bool juce::detail::MouseInputSourceImpl::isDragging ( ) const
inlinenoexcept

◆ isLongPressOrDrag()

◆ isUpdatePending()

bool juce::AsyncUpdater::isUpdatePending ( ) const
noexceptinherited

Returns true if there's an update callback in the pipeline.

◆ registerMouseDown()

◆ registerMouseDrag()

void juce::detail::MouseInputSourceImpl::registerMouseDrag ( Point< float screenPos)
inlineprivatenoexcept

◆ revealCursor()

void juce::detail::MouseInputSourceImpl::revealCursor ( bool  forcedUpdate)
inline

◆ sendMagnifyGesture()

void juce::detail::MouseInputSourceImpl::sendMagnifyGesture ( Component comp,
Point< float screenPos,
Time  time,
float  amount 
)
inline

◆ sendMouseDown()

void juce::detail::MouseInputSourceImpl::sendMouseDown ( Component comp,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ sendMouseDrag()

void juce::detail::MouseInputSourceImpl::sendMouseDrag ( Component comp,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ sendMouseEnter()

void juce::detail::MouseInputSourceImpl::sendMouseEnter ( Component comp,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ sendMouseExit()

void juce::detail::MouseInputSourceImpl::sendMouseExit ( Component comp,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ sendMouseMove()

void juce::detail::MouseInputSourceImpl::sendMouseMove ( Component comp,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ sendMouseUp()

void juce::detail::MouseInputSourceImpl::sendMouseUp ( Component comp,
const detail::PointerState pointerState,
Time  time,
ModifierKeys  oldMods 
)
inline

◆ sendMouseWheel()

void juce::detail::MouseInputSourceImpl::sendMouseWheel ( Component comp,
Point< float screenPos,
Time  time,
const MouseWheelDetails wheel 
)
inline

◆ setButtons()

◆ setComponentUnderMouse()

void juce::detail::MouseInputSourceImpl::setComponentUnderMouse ( Component newComponent,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ setPeer()

void juce::detail::MouseInputSourceImpl::setPeer ( ComponentPeer newPeer,
const detail::PointerState pointerState,
Time  time 
)
inline

◆ setPointerState()

◆ setScreenPosition()

void juce::detail::MouseInputSourceImpl::setScreenPosition ( Point< float p)
inline

◆ showMouseCursor()

◆ triggerAsyncUpdate()

void juce::AsyncUpdater::triggerAsyncUpdate ( )
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().

◆ triggerFakeMove()

void juce::detail::MouseInputSourceImpl::triggerFakeMove ( )
inline

Member Data Documentation

◆ activeMessage

ReferenceCountedObjectPtr<AsyncUpdaterMessage> juce::AsyncUpdater::activeMessage
privateinherited

◆ buttonState

ModifierKeys juce::detail::MouseInputSourceImpl::buttonState

◆ componentUnderMouse

WeakReference<Component> juce::detail::MouseInputSourceImpl::componentUnderMouse
private

◆ currentCursorHandle

void* juce::detail::MouseInputSourceImpl::currentCursorHandle = nullptr
private

Referenced by showMouseCursor().

◆ index

const int juce::detail::MouseInputSourceImpl::index

◆ inputType

const MouseInputSource::InputSourceType juce::detail::MouseInputSourceImpl::inputType

Referenced by getRawScreenPosition(), and setButtons().

◆ isCursorVisibleUntilOffscreen

bool juce::detail::MouseInputSourceImpl::isCursorVisibleUntilOffscreen = false

◆ isUnboundedMouseModeOn

bool juce::detail::MouseInputSourceImpl::isUnboundedMouseModeOn = false

◆ lastNonInertialWheelTarget

WeakReference<Component> juce::detail::MouseInputSourceImpl::lastNonInertialWheelTarget
private

Referenced by handleWheel(), and registerMouseDown().

◆ lastPeer

ComponentPeer* juce::detail::MouseInputSourceImpl::lastPeer = nullptr
private

Referenced by getPeer(), and setPeer().

◆ lastPointerState

◆ lastTime

Time juce::detail::MouseInputSourceImpl::lastTime
private

◆ mouseDowns

◆ mouseEventCounter

int juce::detail::MouseInputSourceImpl::mouseEventCounter = 0
private

◆ movedSignificantly

bool juce::detail::MouseInputSourceImpl::movedSignificantly = false
private

◆ unboundedMouseOffset

Point<float> juce::detail::MouseInputSourceImpl::unboundedMouseOffset

The documentation for this class was generated from the following file: