forked from KOed/welly
-
Notifications
You must be signed in to change notification settings - Fork 1
/
WLMouseHotspotHandler.m
54 lines (47 loc) · 1.15 KB
/
WLMouseHotspotHandler.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// WLMouseHotspotHandler.m
// Welly
//
// Created by K.O.ed on 09-1-27.
// Copyright 2009 Welly Group. All rights reserved.
//
#import "WLMouseHotspotHandler.h"
#import "WLTerminalView.h"
#import "WLEffectView.h"
#import "WLGlobalConfig.h"
#import "WLMouseBehaviorManager.h"
@implementation WLMouseHotspotHandler
@synthesize manager = _manager;
- (id)init {
self = [super init];
_trackingAreas = [[NSMutableArray alloc] initWithCapacity:10];
return self;
}
- (id)initWithView:(WLTerminalView *)view {
[self init];
_view = view;
_maxRow = [[WLGlobalConfig sharedInstance] row];
_maxColumn = [[WLGlobalConfig sharedInstance] column];
return self;
}
- (id)initWithManager:(WLMouseBehaviorManager *)manager {
_manager = manager;
return [self initWithView:[_manager view]];
}
- (void)dealloc {
[_trackingAreas release];
[super dealloc];
}
- (void)mouseEntered:(NSEvent *)theEvent {
// Do nothing, just a virtual function
}
- (void)removeAllTrackingAreas {
for (NSTrackingArea *trackingArea in _trackingAreas) {
[_manager removeTrackingArea:trackingArea];
}
[_trackingAreas removeAllObjects];
}
- (void)clear {
[self removeAllTrackingAreas];
}
@end