forked from eczarny/spectacle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpectacleWindowPositionManager.h
61 lines (45 loc) · 1.96 KB
/
SpectacleWindowPositionManager.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
#import <Foundation/Foundation.h>
#import <ZeroKit/ZeroKit.h>
#define MovingToCenterRegionOfDisplay(action) (action == SpectacleWindowActionCenter)
#define MovingToTopRegionOfDisplay(action) ((action == SpectacleWindowActionTopHalf) || (action == SpectacleWindowActionUpperLeft) || (action == SpectacleWindowActionUpperRight))
#define MovingToUpperOrLowerLeftOfDisplay(action) ((action == SpectacleWindowActionUpperLeft) || (action == SpectacleWindowActionLowerLeft))
#define MovingToUpperOrLowerRightDisplay(action) ((action == SpectacleWindowActionUpperRight) || (action == SpectacleWindowActionLowerRight))
#pragma mark -
#define MovingToThirdOfDisplay(action) ((action == SpectacleWindowActionNextThird) || (action == SpectacleWindowActionPreviousThird))
#pragma mark -
enum {
SpectacleWindowActionUndo = -4,
SpectacleWindowActionRedo,
SpectacleWindowActionLarger,
SpectacleWindowActionSmaller,
SpectacleWindowActionNone,
SpectacleWindowActionCenter,
SpectacleWindowActionFullscreen,
SpectacleWindowActionLeftHalf,
SpectacleWindowActionUpperLeft,
SpectacleWindowActionLowerLeft,
SpectacleWindowActionRightHalf,
SpectacleWindowActionUpperRight,
SpectacleWindowActionLowerRight,
SpectacleWindowActionTopHalf,
SpectacleWindowActionBottomHalf,
SpectacleWindowActionNextDisplay,
SpectacleWindowActionPreviousDisplay,
SpectacleWindowActionNextThird,
SpectacleWindowActionPreviousThird
};
typedef NSInteger SpectacleWindowAction;
@interface SpectacleWindowPositionManager : NSObject {
NSMutableDictionary *applicationHistories;
NSMutableSet *blacklistedWindowRects;
NSMutableSet *blacklistedApplications;
}
+ (SpectacleWindowPositionManager *)sharedManager;
#pragma mark -
- (void)moveFrontMostWindowWithAction: (SpectacleWindowAction)action;
#pragma mark -
- (void)undoLastWindowAction;
- (void)redoLastWindowAction;
#pragma mark -
- (SpectacleWindowAction)windowActionForHotKey: (ZKHotKey *)hotKey;
@end