1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Moved some mouse code out of Desktop class. Made the MouseInputSource class pass-by-value.

This commit is contained in:
jules 2013-09-03 10:44:55 +01:00
parent 380a303adf
commit be1d5253ee
22 changed files with 246 additions and 237 deletions

View file

@ -50,14 +50,13 @@ class JUCE_API MouseInputSource
{
public:
//==============================================================================
/** Creates a MouseInputSource.
You should never actually create a MouseInputSource in your own code - the
library takes care of managing these objects.
*/
MouseInputSource (int index, bool isMouseDevice);
MouseInputSource (const MouseInputSource&) noexcept;
MouseInputSource& operator= (const MouseInputSource&) noexcept;
~MouseInputSource() noexcept;
/** Destructor. */
~MouseInputSource();
//==============================================================================
bool operator== (const MouseInputSource& other) const noexcept { return pimpl == other.pimpl; }
bool operator!= (const MouseInputSource& other) const noexcept { return pimpl != other.pimpl; }
//==============================================================================
/** Returns true if this object represents a normal desk-based mouse device. */
@ -157,7 +156,7 @@ public:
hidden; if true, it will only be hidden when it
is moved beyond the edge of the screen
*/
void enableUnboundedMouseMovement (bool isEnabled, bool keepCursorVisibleUntilOffscreen = false);
void enableUnboundedMouseMovement (bool isEnabled, bool keepCursorVisibleUntilOffscreen = false) const;
/** Attempts to set this mouse pointer's screen position. */
void setScreenPosition (Point<int> newPosition);
@ -165,9 +164,13 @@ public:
private:
//==============================================================================
friend class ComponentPeer;
friend class Desktop;
friend class MouseInputSourceInternal;
ScopedPointer<MouseInputSourceInternal> pimpl;
MouseInputSourceInternal* pimpl;
struct SourceList;
explicit MouseInputSource (MouseInputSourceInternal*) noexcept;
void handleEvent (ComponentPeer&, Point<int>, int64 time, const ModifierKeys);
void handleWheel (ComponentPeer&, Point<int>, int64 time, const MouseWheelDetails&);
void handleMagnifyGesture (ComponentPeer&, Point<int>, int64 time, float scaleFactor);
@ -175,7 +178,7 @@ private:
static Point<int> getCurrentRawMousePosition();
static void setRawMousePosition (Point<int>);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MouseInputSource)
JUCE_LEAK_DETECTOR (MouseInputSource)
};