-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVNCView.h
162 lines (142 loc) · 4.46 KB
/
VNCView.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//
// VNCView.h
// Vnsea
//
// Created by Chris Reed on 9/5/07.
// Copyright 2007 __MyCompanyName__. All rights reserved.
//
#import <CoreFoundation/CoreFoundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/CDStructures.h>
#import <UIKit/UIWindow.h>
#import <UIKit/UIView-Hierarchy.h>
#import <UIKit/UIHardware.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIApplication.h>
#import <UIKit/UINavBarButton.h>
#import <UIKit/UIPushButton.h>
#import <UIKit/UIKeyboard.h>
#import <UIKit/UIKeyboardInput.h>
#import <UIKit/UISegmentedControl.h>
#import <CoreGraphics/CoreGraphics.h>
#import "RFBConnection.h"
#import "EventFilter.h"
#import "FrameBuffer.h"
#import "RFBViewProtocol.h"
#import "VNCContentView.h"
#import "VNCScrollerView.h"
#import "VNCPopupWindow.h"
//! @brief Modes for screen scaling.
typedef enum
{
kScaleFitNone = 0,
kScaleFitWidth = 1,
kScaleFitHeight = 2,
kScaleFitWhole = 3
} scaleSpecialTypes;
/*!
* @brief Main view to display and control the remote computer.
*
* This view class handles everything related to showing the remote display
* and interacting with it. It is tightly coupled with the RFBConnection
* instance and is its delegate. The actual drawing of the framebuffer
* is done by the VNCContentView that the child of the scroller view.
* A number of method invocations are forwarded to the content
* view rather than be implemented directly by this class.
*
* The view hierarchy looks like this:
*
* VNCView -> VNCScrollerView -> VNCContentView
*
*
*/
@interface VNCView : UIView <RFBViewProtocol>
{
id _delegate;
RFBConnection * _connection; //!< The connection object, nil if not currently connected.
EventFilter * _filter; //!< Event filter for the current connection.
VNCScrollerView * _scroller; //!< Scroller subview.
VNCContentView * _screenView; //!< Child content view that draws the framebuffer.
UINavBarButton * _keyboardButton; //
UINavBarButton * _shiftButton;
UINavBarButton * _commandButton;
UINavBarButton * _optionButton;
UINavBarButton * _controlButton;
UINavBarButton * _rightMouseButton;
UINavBarButton * _exitButton; //
UINavBarButton *_helperFunctionButton;
UIThreePartButton * _fitWidthButton;
UIThreePartButton * _fitHeightButton;
UIThreePartButton *_fitWholeButton;
UIThreePartButton *_fitNoneButton;
UISegmentedControl * _widthHeightFullSegment;
id _keyboardView;
id _controlsView;
bool _areControlsVisible;
bool _savedControlShowState;
bool _isKeyboardVisible;
CGSize _vncScreenSize;
CGSize _ipodScreenSize;
scaleSpecialTypes _scaleState;
bool _isFirstDisplay; //!< Did we have our first display from VNC protocol?
CGPoint _ptStartupTopLeft; //!< When we get our first display scroll to this point.
NSString *_remoteComputerName;
}
//! @name Delegate
//@{
- (id)delegate;
- (void)setDelegate:(id)theDelegate;
//@}
-(void)toggleViewOnly;
- (bool)isFirstDisplay;
//! @name Controls and keyboard
//@{
- (void)layoutControlsBar;
- (bool)areControlsVisible;
- (void)showControls:(bool)show;
- (void)toggleControls;
- (void)toggleKeyboard:(id)sender;
- (void)toggleFitWidthHeight:(id)sender;
- (void)showHelperFunctions:(id)sender;
- (void)closeConnection:(id)sender;
- (void)toggleRightMouse:(id)sender;
- (void)toggleModifierKey:(id)sender;
- (void)enableControlsForViewOnly:(bool)isViewOnly;
- (float)scaleFitCurrentScreen: (scaleSpecialTypes) wScaleState;
//@}
//! @name RFBViewProtocol
//@{
- (void)setRemoteComputerName:(NSString *)name;
- (void)setRemoteDisplaySize:(CGSize)remoteSize;
- (void)setFrameBuffer:(id)aBuffer;
- (void)setConnection:(RFBConnection *)connection;
- (RFBConnection *)connection;
- (void)displayFromBuffer:(CGRect)aRect;
- (void)drawRectList:(id)aList;
//@}
- (id)scroller;
//! @name Orientation
//@{
- (float)orientationDegree;
- (void)setOrientation:(UIHardwareOrientation)wOrientation bForce:(int)bForce;
- (UIHardwareOrientation)getOrientationState;
//@}
//! @name Scaling
//@{
- (void)setScalePercent:(float)x;
- (float)getScalePercent;
- (void)setScaleState: (scaleSpecialTypes)wState;
- (scaleSpecialTypes)getScaleState;
//@}
- (void)changeViewPinnedToPoint:(CGPoint)ptPinned scale:(float)fScale orientation:(UIHardwareOrientation)wOrientationState force:(BOOL)bForce;
- (CGRect)getFrame;
- (CGPoint)getIPodScreenPoint:(CGRect)r bounds:(CGRect)bounds;
- (CGPoint)topLeftVisiblePt;
- (void)sendFunctionKeys:(id)sender;
- (void)sendTabKey:(id)sender;
- (CGRect)scrollerFrame;
- (void)setStartupTopLeftPt:(CGPoint)pt;
@end
@interface VNCView (DelegateMethods)
- (void)closeConnection;
@end