-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
TPLayoutHostView.h
84 lines (62 loc) · 2.14 KB
/
TPLayoutHostView.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
80
81
82
83
84
//
// TPLayoutHost.h
// teleport
//
// Created by JuL on Sun Feb 29 2004.
// Copyright (c) 2003-2005 abyssoft. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TPLayoutView.h"
#define ROUND_RECT 1
#define FLIPPED_VIEW 0
#if ROUND_RECT
#define FORDRAW_ORIGIN(x) (round(x))
#define FORDRAW_SIZE(x) (round(x))
#else
#define FORDRAW_ORIGIN(x) (x)
#define FORDRAW_SIZE(x) (x)
#endif
#define MIN_SCALE 0.01
#define MAX_SCALE 0.2
typedef NS_ENUM(NSInteger, TPDrawMode) {NORMAL_MODE, DISABLED_MODE, SELECTED_MODE} ;
@class TPHost, TPLayoutHostView;
@interface NSBezierPath (TeleportAdditions)
+ (void)drawRect:(NSRect)rect withGradientFrom:(NSColor*)colorStart to:(NSColor*)colorEnd;
@end
@interface TPLayoutScreenView : NSView
{
TPLayoutHostView * _hostView;
unsigned _screenIndex;
}
- (instancetype) initWithHostView:(TPLayoutHostView*)hostView screenIndex:(unsigned)screenIndex NS_DESIGNATED_INITIALIZER;
@property (nonatomic, readonly, strong) TPLayoutHostView *hostView;
@property (nonatomic, readonly, strong) NSScreen *screen;
@property (nonatomic, readonly) unsigned int screenIndex;
@property (nonatomic, getter=isMainScreen, readonly) BOOL mainScreen;
- (void)update;
- (void)drawHostTitleInRect:(NSRect)rect dimmed:(BOOL)dimmed;
@end
@interface TPLayoutHostView : NSView
{
NSString * _hostIdentifier;
TPLayoutView * _layoutView;
NSPoint _origin;
TPDrawMode drawMode;
}
//- (void)setRealFrame:(NSRect)frame;
+ (Class)screenViewClass;
- (instancetype) initWithHost:(TPHost*)host layoutView:(TPLayoutView*)layoutView NS_DESIGNATED_INITIALIZER;
@property (nonatomic, copy) NSString *hostIdentifier;
@property (nonatomic, readonly, strong) TPHost *host;
@property (nonatomic, readonly) NSRect totalFrame;
@property (nonatomic, readonly, copy) NSArray *screenViews;
- (unsigned)indexOfScreenAtPoint:(NSPoint)point;
- (TPLayoutScreenView*)screenViewAtIndex:(unsigned)index;
- (NSRect)screenFrameAtIndex:(unsigned)index;
- (NSRect)hostFrameFromScreenFrame:(NSRect)frame atIndex:(unsigned)index;
- (void)updateLayoutWithScaleFactor:(float)scaleFactor;
#if 0
- (void)setDrawMode:(TPDrawMode)drawMode;
- (void)setOrigin:(NSPoint)origin;
#endif
@end