-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
TPHotBorder.h
79 lines (59 loc) · 2.09 KB
/
TPHotBorder.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// TPHotBorder.h
// Teleport
//
// Created by JuL on Sun Dec 07 2003.
// Copyright (c) 2003-2005 abyssoft. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TPHostSnapping.h"
#define DEBUG_HOTBORDER 0
#if DEBUG_HOTBORDER
#define BORDER_SIZE 4.0
#else
#define BORDER_SIZE 1.0
#endif
@class TPHotBorderView;
typedef NS_ENUM(NSInteger, TPHotBorderState) {
TPHotBorderInactiveState,
TPHotBorderActivatingState,
TPHotBorderActiveState
} ;
@interface TPHotBorder : NSWindow
{
TPHotBorderState _state;
BOOL _doubleTap;
BOOL _acceptDrags;
id _hotDelegate;
NSString * identifier;
NSTrackingRectTag _trackingRectTag;
NSTimer * _fireTimer;
NSTimer * _tapTimer;
TPSide _side;
}
+ (TPHotBorder*)hotBorderRepresentingRect:(NSRect)representedRect inRect:(NSRect)parentRect;
+ (NSRect)hotRectWithRepresentingRect:(NSRect)representedRect inRect:(NSRect)parentRect;
- (instancetype) initWithRepresentingRect:(NSRect)representedRect inRect:(NSRect)parentRect NS_DESIGNATED_INITIALIZER;
- (void)updateWithRepresentingRect:(NSRect)representedRect inRect:(NSRect)parentRect;
@property (nonatomic) BOOL doubleTap;
@property (nonatomic) BOOL acceptDrags;
- (void)setDelegate:(id)delegate;
@property (nonatomic, copy) NSString *identifier;
- (void)setOpaqueToMouseEvents:(BOOL)opaque;
@property (nonatomic, readonly) NSRect hotRect;
@property (nonatomic, readonly) TPSide side;
- (void)activate;
- (void)delayedActivate;
- (void)deactivate;
@property (nonatomic, readonly) TPHotBorderState state;
- (void)fireAtLocation:(NSPoint)location withDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
- (NSPoint)screenPointFromLocalPoint:(NSPoint)localPoint flipped:(BOOL)flipped;
@end
@interface TPHotBorder (Private)
- (void)_fireAtLocation:(NSPoint)location withDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
@end
@interface NSObject (TPHotBorder_delegate)
- (float)hotBorderSwitchDelay:(TPHotBorder*)hotBorder;
- (BOOL)hotBorder:(TPHotBorder*)hotBorder canFireWithEvent:(NSEvent*)event;
- (BOOL)hotBorder:(TPHotBorder*)hotBorder firedAtLocation:(NSPoint)location withDraggingInfo:(id <NSDraggingInfo>)draggingInfo;
@end