New: -CPEvent subtype.

This commit is contained in:
Alexander Ljungberg committed 2016-08-19 12:45:41 +01:00
1 parent beb3646bef
commit c233abe3a4
1 file changed
+13 -5
+13 -5
View File
@@ -83,7 +83,7 @@ var _CPEventPeriodicEventPeriod = 0,
BOOL _suppressCappuccinoCut;
BOOL _suppressCappuccinoPaste;
#endif
CPTrackingArea _trackingArea;
}
@@ -146,7 +146,7 @@ var _CPEventPeriodicEventPeriod = 0,
/*!
Creates a new mouse tracking event.
@param anEventType the event type
@param aPoint the location of the cursor in the window specified by \c aWindowNumber
@param modifierFlags a bitwise combination of the modifiers specified in the CPEvent globals
@@ -232,7 +232,7 @@ var _CPEventPeriodicEventPeriod = 0,
{
if ((anEventType != CPMouseEntered) && (anEventType != CPMouseExited) && (anEventType != CPCursorUpdate))
[CPException raise:CPInternalInconsistencyException reason:"Invalid event type"];
if (self = [self _initWithType:anEventType])
{
_location = CGPointCreateCopy(aPoint);
@@ -243,7 +243,7 @@ var _CPEventPeriodicEventPeriod = 0,
_trackingArea = aTrackingArea;
_window = [CPApp windowWithWindowNumber:aWindowNumber];
}
return self;
}
@@ -336,6 +336,14 @@ var _CPEventPeriodicEventPeriod = 0,
return _type;
}
/*!
Returns the subtype of the event.
*/
- (CPEventType)subtype
{
return _subtype;
}
/*!
Returns the event's associated window.
*/
@@ -633,7 +641,7 @@ var _CPEventPeriodicEventPeriod = 0,
{
if ((_type !== CPMouseEntered) && (_type !== CPMouseExited) && (_type !== CPCursorUpdate))
[CPException raise:CPInternalInconsistencyException format:@"You can't call trackingArea for events of type %#x", _type]
return _trackingArea;
}