|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 |
- /*
- ==============================================================================
-
- This file is part of the JUCE library.
- Copyright (c) 2013 - Raw Material Software Ltd.
-
- Permission is granted to use this software under the terms of either:
- a) the GPL v2 (or any later version)
- b) the Affero GPL v3
-
- Details of these licenses can be found at: www.gnu.org/licenses
-
- JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
- ------------------------------------------------------------------------------
-
- To release a closed-source product which uses JUCE, commercial licenses are
- available: visit www.juce.com for more information.
-
- ==============================================================================
- */
-
- class MouseInputSourceInternal : private AsyncUpdater
- {
- public:
- //==============================================================================
- MouseInputSourceInternal (const int i, const bool isMouse)
- : index (i), isMouseDevice (isMouse),
- isUnboundedMouseModeOn (false), isCursorVisibleUntilOffscreen (false),
- lastPeer (nullptr), currentCursorHandle (nullptr),
- mouseEventCounter (0), mouseMovedSignificantlySincePressed (false)
- {
- }
-
- //==============================================================================
- bool isDragging() const noexcept
- {
- return buttonState.isAnyMouseButtonDown();
- }
-
- Component* getComponentUnderMouse() const
- {
- return componentUnderMouse.get();
- }
-
- ModifierKeys getCurrentModifiers() const
- {
- return ModifierKeys::getCurrentModifiers().withoutMouseButtons().withFlags (buttonState.getRawFlags());
- }
-
- ComponentPeer* getPeer()
- {
- if (! ComponentPeer::isValidPeer (lastPeer))
- lastPeer = nullptr;
-
- return lastPeer;
- }
-
- static Point<int> screenPosToLocalPos (Component& comp, Point<int> pos)
- {
- if (ComponentPeer* const peer = comp.getPeer())
- {
- pos = peer->globalToLocal (pos);
- Component& peerComp = peer->getComponent();
- return comp.getLocalPoint (&peerComp, ScalingHelpers::unscaledScreenPosToScaled (peerComp, pos));
- }
-
- return comp.getLocalPoint (nullptr, ScalingHelpers::unscaledScreenPosToScaled (comp, pos));
- }
-
- Component* findComponentAt (Point<int> screenPos)
- {
- if (ComponentPeer* const peer = getPeer())
- {
- Point<int> relativePos (ScalingHelpers::unscaledScreenPosToScaled (peer->getComponent(),
- peer->globalToLocal (screenPos)));
- Component& comp = peer->getComponent();
-
- // (the contains() call is needed to test for overlapping desktop windows)
- if (comp.contains (relativePos))
- return comp.getComponentAt (relativePos);
- }
-
- return nullptr;
- }
-
- Point<int> getScreenPosition() const
- {
- // This needs to return the live position if possible, but it mustn't update the lastScreenPos
- // value, because that can cause continuity problems.
- return ScalingHelpers::unscaledScreenPosToScaled
- (unboundedMouseOffset + (isMouseDevice ? MouseInputSource::getCurrentRawMousePosition()
- : lastScreenPos));
- }
-
- void setScreenPosition (Point<int> p)
- {
- MouseInputSource::setRawMousePosition (ScalingHelpers::scaledScreenPosToUnscaled (p));
- }
-
- //==============================================================================
- #if JUCE_DUMP_MOUSE_EVENTS
- #define JUCE_MOUSE_EVENT_DBG(desc) DBG ("Mouse " desc << " #" << source.getIndex() \
- << ": " << screenPosToLocalPos (comp, screenPos).toString() \
- << " - Comp: " << String::toHexString ((int) &comp));
- #else
- #define JUCE_MOUSE_EVENT_DBG(desc)
- #endif
-
- void sendMouseEnter (Component& comp, Point<int> screenPos, Time time)
- {
- JUCE_MOUSE_EVENT_DBG ("enter")
- comp.internalMouseEnter (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time);
- }
-
- void sendMouseExit (Component& comp, Point<int> screenPos, Time time)
- {
- JUCE_MOUSE_EVENT_DBG ("exit")
- comp.internalMouseExit (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time);
- }
-
- void sendMouseMove (Component& comp, Point<int> screenPos, Time time)
- {
- JUCE_MOUSE_EVENT_DBG ("move")
- comp.internalMouseMove (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time);
- }
-
- void sendMouseDown (Component& comp, Point<int> screenPos, Time time)
- {
- JUCE_MOUSE_EVENT_DBG ("down")
- comp.internalMouseDown (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time);
- }
-
- void sendMouseDrag (Component& comp, Point<int> screenPos, Time time)
- {
- JUCE_MOUSE_EVENT_DBG ("drag")
- comp.internalMouseDrag (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time);
- }
-
- void sendMouseUp (Component& comp, Point<int> screenPos, Time time, const ModifierKeys oldMods)
- {
- JUCE_MOUSE_EVENT_DBG ("up")
- comp.internalMouseUp (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time, oldMods);
- }
-
- void sendMouseWheel (Component& comp, Point<int> screenPos, Time time, const MouseWheelDetails& wheel)
- {
- JUCE_MOUSE_EVENT_DBG ("wheel")
- comp.internalMouseWheel (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time, wheel);
- }
-
- void sendMagnifyGesture (Component& comp, Point<int> screenPos, Time time, const float amount)
- {
- JUCE_MOUSE_EVENT_DBG ("magnify")
- comp.internalMagnifyGesture (MouseInputSource (this), screenPosToLocalPos (comp, screenPos), time, amount);
- }
-
- //==============================================================================
- // (returns true if the button change caused a modal event loop)
- bool setButtons (Point<int> screenPos, Time time, const ModifierKeys newButtonState)
- {
- if (buttonState == newButtonState)
- return false;
-
- // (avoid sending a spurious mouse-drag when we receive a mouse-up)
- if (! (isDragging() && ! newButtonState.isAnyMouseButtonDown()))
- setScreenPos (screenPos, time, false);
-
- // (ignore secondary clicks when there's already a button down)
- if (buttonState.isAnyMouseButtonDown() == newButtonState.isAnyMouseButtonDown())
- {
- buttonState = newButtonState;
- return false;
- }
-
- const int lastCounter = mouseEventCounter;
-
- if (buttonState.isAnyMouseButtonDown())
- {
- if (Component* const current = getComponentUnderMouse())
- {
- const ModifierKeys oldMods (getCurrentModifiers());
- buttonState = newButtonState; // must change this before calling sendMouseUp, in case it runs a modal loop
-
- sendMouseUp (*current, screenPos + unboundedMouseOffset, time, oldMods);
-
- if (lastCounter != mouseEventCounter)
- return true; // if a modal loop happened, then newButtonState is no longer valid.
- }
-
- enableUnboundedMouseMovement (false, false);
- }
-
- buttonState = newButtonState;
-
- if (buttonState.isAnyMouseButtonDown())
- {
- Desktop::getInstance().incrementMouseClickCounter();
-
- if (Component* const current = getComponentUnderMouse())
- {
- registerMouseDown (screenPos, time, *current, buttonState);
- sendMouseDown (*current, screenPos, time);
- }
- }
-
- return lastCounter != mouseEventCounter;
- }
-
- void setComponentUnderMouse (Component* const newComponent, Point<int> screenPos, Time time)
- {
- Component* current = getComponentUnderMouse();
-
- if (newComponent != current)
- {
- WeakReference<Component> safeNewComp (newComponent);
- const ModifierKeys originalButtonState (buttonState);
-
- if (current != nullptr)
- {
- WeakReference<Component> safeOldComp (current);
- setButtons (screenPos, time, ModifierKeys());
-
- if (safeOldComp != nullptr)
- {
- componentUnderMouse = safeNewComp;
- sendMouseExit (*safeOldComp, screenPos, time);
- }
-
- buttonState = originalButtonState;
- }
-
- current = componentUnderMouse = safeNewComp;
-
- if (current != nullptr)
- sendMouseEnter (*current, screenPos, time);
-
- revealCursor (false);
- setButtons (screenPos, time, originalButtonState);
- }
- }
-
- void setPeer (ComponentPeer& newPeer, Point<int> screenPos, Time time)
- {
- ModifierKeys::updateCurrentModifiers();
-
- if (&newPeer != lastPeer)
- {
- setComponentUnderMouse (nullptr, screenPos, time);
- lastPeer = &newPeer;
- setComponentUnderMouse (findComponentAt (screenPos), screenPos, time);
- }
- }
-
- void setScreenPos (Point<int> newScreenPos, Time time, const bool forceUpdate)
- {
- if (! isDragging())
- setComponentUnderMouse (findComponentAt (newScreenPos), newScreenPos, time);
-
- if (newScreenPos != lastScreenPos || forceUpdate)
- {
- cancelPendingUpdate();
- lastScreenPos = newScreenPos;
-
- if (Component* const current = getComponentUnderMouse())
- {
- if (isDragging())
- {
- registerMouseDrag (newScreenPos);
- sendMouseDrag (*current, newScreenPos + unboundedMouseOffset, time);
-
- if (isUnboundedMouseModeOn)
- handleUnboundedDrag (current);
- }
- else
- {
- sendMouseMove (*current, newScreenPos, time);
- }
- }
-
- revealCursor (false);
- }
- }
-
- //==============================================================================
- void handleEvent (ComponentPeer& newPeer, Point<int> positionWithinPeer, Time time, const ModifierKeys newMods)
- {
- lastTime = time;
- ++mouseEventCounter;
- const Point<int> screenPos (newPeer.localToGlobal (positionWithinPeer));
-
- if (isDragging() && newMods.isAnyMouseButtonDown())
- {
- setScreenPos (screenPos, time, false);
- }
- else
- {
- setPeer (newPeer, screenPos, time);
-
- if (ComponentPeer* peer = getPeer())
- {
- if (setButtons (screenPos, time, newMods))
- return; // some modal events have been dispatched, so the current event is now out-of-date
-
- peer = getPeer();
- if (peer != nullptr)
- setScreenPos (screenPos, time, false);
- }
- }
- }
-
- Component* getTargetForGesture (ComponentPeer& peer, Point<int> positionWithinPeer,
- Time time, Point<int>& screenPos)
- {
- lastTime = time;
- ++mouseEventCounter;
-
- screenPos = peer.localToGlobal (positionWithinPeer);
- setPeer (peer, screenPos, time);
- setScreenPos (screenPos, time, false);
- triggerFakeMove();
-
- return isDragging() ? nullptr : getComponentUnderMouse();
- }
-
- void handleWheel (ComponentPeer& peer, Point<int> positionWithinPeer,
- Time time, const MouseWheelDetails& wheel)
- {
- Desktop::getInstance().incrementMouseWheelCounter();
-
- Point<int> screenPos;
- if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
- sendMouseWheel (*current, screenPos, time, wheel);
- }
-
- void handleMagnifyGesture (ComponentPeer& peer, Point<int> positionWithinPeer,
- Time time, const float scaleFactor)
- {
- Point<int> screenPos;
- if (Component* current = getTargetForGesture (peer, positionWithinPeer, time, screenPos))
- sendMagnifyGesture (*current, screenPos, time, scaleFactor);
- }
-
- //==============================================================================
- Time getLastMouseDownTime() const noexcept { return mouseDowns[0].time; }
- Point<int> getLastMouseDownPosition() const noexcept { return ScalingHelpers::unscaledScreenPosToScaled (mouseDowns[0].position); }
-
- int getNumberOfMultipleClicks() const noexcept
- {
- int numClicks = 0;
-
- if (mouseDowns[0].time != Time())
- {
- if (! mouseMovedSignificantlySincePressed)
- ++numClicks;
-
- for (int i = 1; i < numElementsInArray (mouseDowns); ++i)
- {
- if (mouseDowns[0].canBePartOfMultipleClickWith (mouseDowns[i], MouseEvent::getDoubleClickTimeout() * jmin (i, 2)))
- ++numClicks;
- else
- break;
- }
- }
-
- return numClicks;
- }
-
- bool hasMouseMovedSignificantlySincePressed() const noexcept
- {
- return mouseMovedSignificantlySincePressed
- || lastTime > mouseDowns[0].time + RelativeTime::milliseconds (300);
- }
-
- //==============================================================================
- void triggerFakeMove()
- {
- triggerAsyncUpdate();
- }
-
- void handleAsyncUpdate() override
- {
- setScreenPos (lastScreenPos, jmax (lastTime, Time::getCurrentTime()), true);
- }
-
- //==============================================================================
- void enableUnboundedMouseMovement (bool enable, bool keepCursorVisibleUntilOffscreen)
- {
- enable = enable && isDragging();
- isCursorVisibleUntilOffscreen = keepCursorVisibleUntilOffscreen;
-
- if (enable != isUnboundedMouseModeOn)
- {
- if ((! enable) && ((! isCursorVisibleUntilOffscreen) || ! unboundedMouseOffset.isOrigin()))
- {
- // when released, return the mouse to within the component's bounds
- if (Component* current = getComponentUnderMouse())
- Desktop::setMousePosition (current->getScreenBounds()
- .getConstrainedPoint (lastScreenPos));
- }
-
- isUnboundedMouseModeOn = enable;
- unboundedMouseOffset = Point<int>();
-
- revealCursor (true);
- }
- }
-
- void handleUnboundedDrag (Component* current)
- {
- const Rectangle<int> screenArea (current->getParentMonitorArea().expanded (-2, -2));
-
- if (! screenArea.contains (lastScreenPos))
- {
- const Point<int> componentCentre (current->getScreenBounds().getCentre());
- unboundedMouseOffset += (lastScreenPos - componentCentre);
- Desktop::setMousePosition (componentCentre);
- }
- else if (isCursorVisibleUntilOffscreen
- && (! unboundedMouseOffset.isOrigin())
- && screenArea.contains (lastScreenPos + unboundedMouseOffset))
- {
- Desktop::setMousePosition (lastScreenPos + unboundedMouseOffset);
- unboundedMouseOffset = Point<int>();
- }
- }
-
- //==============================================================================
- void showMouseCursor (MouseCursor cursor, bool forcedUpdate)
- {
- if (isUnboundedMouseModeOn && ((! unboundedMouseOffset.isOrigin()) || ! isCursorVisibleUntilOffscreen))
- {
- cursor = MouseCursor::NoCursor;
- forcedUpdate = true;
- }
-
- if (forcedUpdate || cursor.getHandle() != currentCursorHandle)
- {
- currentCursorHandle = cursor.getHandle();
- cursor.showInWindow (getPeer());
- }
- }
-
- void hideCursor()
- {
- showMouseCursor (MouseCursor::NoCursor, true);
- }
-
- void revealCursor (bool forcedUpdate)
- {
- MouseCursor mc (MouseCursor::NormalCursor);
-
- if (Component* current = getComponentUnderMouse())
- mc = current->getLookAndFeel().getMouseCursorFor (*current);
-
- showMouseCursor (mc, forcedUpdate);
- }
-
- //==============================================================================
- const int index;
- const bool isMouseDevice;
- Point<int> lastScreenPos;
- ModifierKeys buttonState;
-
- Point<int> unboundedMouseOffset;
- bool isUnboundedMouseModeOn, isCursorVisibleUntilOffscreen;
-
- private:
- WeakReference<Component> componentUnderMouse;
- ComponentPeer* lastPeer;
-
- void* currentCursorHandle;
- int mouseEventCounter;
-
- struct RecentMouseDown
- {
- RecentMouseDown() noexcept : peerID (0) {}
-
- Point<int> position;
- Time time;
- ModifierKeys buttons;
- uint32 peerID;
-
- bool canBePartOfMultipleClickWith (const RecentMouseDown& other, const int maxTimeBetweenMs) const
- {
- return time - other.time < RelativeTime::milliseconds (maxTimeBetweenMs)
- && abs (position.x - other.position.x) < 8
- && abs (position.y - other.position.y) < 8
- && buttons == other.buttons
- && peerID == other.peerID;
- }
- };
-
- RecentMouseDown mouseDowns[4];
- Time lastTime;
- bool mouseMovedSignificantlySincePressed;
-
- void registerMouseDown (Point<int> screenPos, Time time,
- Component& component, const ModifierKeys modifiers) noexcept
- {
- for (int i = numElementsInArray (mouseDowns); --i > 0;)
- mouseDowns[i] = mouseDowns[i - 1];
-
- mouseDowns[0].position = screenPos;
- mouseDowns[0].time = time;
- mouseDowns[0].buttons = modifiers.withOnlyMouseButtons();
-
- if (ComponentPeer* const peer = component.getPeer())
- mouseDowns[0].peerID = peer->getUniqueID();
- else
- mouseDowns[0].peerID = 0;
-
- mouseMovedSignificantlySincePressed = false;
- }
-
- void registerMouseDrag (Point<int> screenPos) noexcept
- {
- mouseMovedSignificantlySincePressed = mouseMovedSignificantlySincePressed
- || mouseDowns[0].position.getDistanceFrom (screenPos) >= 4;
- }
-
- JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MouseInputSourceInternal)
- };
-
- //==============================================================================
- MouseInputSource::MouseInputSource (MouseInputSourceInternal* s) noexcept : pimpl (s) {}
- MouseInputSource::MouseInputSource (const MouseInputSource& other) noexcept : pimpl (other.pimpl) {}
- MouseInputSource::~MouseInputSource() noexcept {}
-
- MouseInputSource& MouseInputSource::operator= (const MouseInputSource& other) noexcept
- {
- pimpl = other.pimpl;
- return *this;
- }
-
- bool MouseInputSource::isMouse() const { return pimpl->isMouseDevice; }
- bool MouseInputSource::isTouch() const { return ! isMouse(); }
- bool MouseInputSource::canHover() const { return isMouse(); }
- bool MouseInputSource::hasMouseWheel() const { return isMouse(); }
- int MouseInputSource::getIndex() const { return pimpl->index; }
- bool MouseInputSource::isDragging() const { return pimpl->isDragging(); }
- Point<int> MouseInputSource::getScreenPosition() const { return pimpl->getScreenPosition(); }
- ModifierKeys MouseInputSource::getCurrentModifiers() const { return pimpl->getCurrentModifiers(); }
- Component* MouseInputSource::getComponentUnderMouse() const { return pimpl->getComponentUnderMouse(); }
- void MouseInputSource::triggerFakeMove() const { pimpl->triggerFakeMove(); }
- int MouseInputSource::getNumberOfMultipleClicks() const noexcept { return pimpl->getNumberOfMultipleClicks(); }
- Time MouseInputSource::getLastMouseDownTime() const noexcept { return pimpl->getLastMouseDownTime(); }
- Point<int> MouseInputSource::getLastMouseDownPosition() const noexcept { return pimpl->getLastMouseDownPosition(); }
- bool MouseInputSource::hasMouseMovedSignificantlySincePressed() const noexcept { return pimpl->hasMouseMovedSignificantlySincePressed(); }
- bool MouseInputSource::canDoUnboundedMovement() const noexcept { return isMouse(); }
- void MouseInputSource::enableUnboundedMouseMovement (bool isEnabled, bool keepCursorVisibleUntilOffscreen) const
- { pimpl->enableUnboundedMouseMovement (isEnabled, keepCursorVisibleUntilOffscreen); }
- bool MouseInputSource::isUnboundedMouseMovementEnabled() const { return pimpl->isUnboundedMouseModeOn; }
- bool MouseInputSource::hasMouseCursor() const noexcept { return isMouse(); }
- void MouseInputSource::showMouseCursor (const MouseCursor& cursor) { pimpl->showMouseCursor (cursor, false); }
- void MouseInputSource::hideCursor() { pimpl->hideCursor(); }
- void MouseInputSource::revealCursor() { pimpl->revealCursor (false); }
- void MouseInputSource::forceMouseCursorUpdate() { pimpl->revealCursor (true); }
- void MouseInputSource::setScreenPosition (Point<int> p) { pimpl->setScreenPosition (p); }
-
- void MouseInputSource::handleEvent (ComponentPeer& peer, Point<int> positionWithinPeer,
- const int64 time, const ModifierKeys mods)
- {
- pimpl->handleEvent (peer, positionWithinPeer, Time (time), mods.withOnlyMouseButtons());
- }
-
- void MouseInputSource::handleWheel (ComponentPeer& peer, Point<int> positionWithinPeer,
- const int64 time, const MouseWheelDetails& wheel)
- {
- pimpl->handleWheel (peer, positionWithinPeer, Time (time), wheel);
- }
-
- void MouseInputSource::handleMagnifyGesture (ComponentPeer& peer, Point<int> positionWithinPeer,
- const int64 time, const float scaleFactor)
- {
- pimpl->handleMagnifyGesture (peer, positionWithinPeer, Time (time), scaleFactor);
- }
-
- //==============================================================================
- struct MouseInputSource::SourceList : public Timer
- {
- SourceList()
- {
- addSource();
- }
-
- bool addSource();
-
- void addSource (int index, bool isMouse)
- {
- MouseInputSourceInternal* s = new MouseInputSourceInternal (index, isMouse);
- sources.add (s);
- sourceArray.add (MouseInputSource (s));
- }
-
- MouseInputSource* getMouseSource (int index) const noexcept
- {
- return isPositiveAndBelow (index, sourceArray.size()) ? &sourceArray.getReference (index)
- : nullptr;
- }
-
- MouseInputSource* getOrCreateMouseInputSource (int touchIndex)
- {
- jassert (touchIndex >= 0 && touchIndex < 100); // sanity-check on number of fingers
-
- for (;;)
- {
- if (MouseInputSource* mouse = getMouseSource (touchIndex))
- return mouse;
-
- if (! addSource())
- {
- jassertfalse; // not enough mouse sources!
- return nullptr;
- }
- }
- }
-
- int getNumDraggingMouseSources() const noexcept
- {
- int num = 0;
-
- for (int i = 0; i < sources.size(); ++i)
- if (sources.getUnchecked(i)->isDragging())
- ++num;
-
- return num;
- }
-
- MouseInputSource* getDraggingMouseSource (int index) const noexcept
- {
- int num = 0;
-
- for (int i = 0; i < sources.size(); ++i)
- {
- MouseInputSource* const mi = &(sourceArray.getReference(i));
-
- if (mi->isDragging())
- {
- if (index == num)
- return mi;
-
- ++num;
- }
- }
-
- return nullptr;
- }
-
- void beginDragAutoRepeat (const int interval)
- {
- if (interval > 0)
- {
- if (getTimerInterval() != interval)
- startTimer (interval);
- }
- else
- {
- stopTimer();
- }
- }
-
- void timerCallback() override
- {
- int numMiceDown = 0;
-
- for (int i = 0; i < sources.size(); ++i)
- {
- MouseInputSourceInternal* const mi = sources.getUnchecked(i);
-
- if (mi->isDragging())
- {
- mi->triggerFakeMove();
- ++numMiceDown;
- }
- }
-
- if (numMiceDown == 0)
- stopTimer();
- }
-
- OwnedArray<MouseInputSourceInternal> sources;
- Array<MouseInputSource> sourceArray;
- };
|