Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Side by Side Diff: remoting/ios/ui/host_view_controller.h

Issue 186733007: iOS Chromoting Client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
6 #define REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
7
8 #import <GLKit/GLKit.h>
9
10 #import "GTMOAuth2Authentication.h"
11
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/scoped_vector.h"
14 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h"
15
16 #import "remoting/ios/host.h"
17 #import "remoting/ios/key_input.h"
18 #import "remoting/ios/utility.h"
19 #import "remoting/ios/bridge/client_controller.h"
20 #import "remoting/ios/ui/pin_entry_view_controller.h"
21
22 @interface HostViewController
23 : GLKViewController<PinEntryViewControllerDelegate,
24 KeyInputDelegate,
25 ClientControllerDelegate,
26 UIGestureRecognizerDelegate,
27 UIToolbarDelegate> {
28 @private
29 IBOutlet UIActivityIndicatorView* _busyIndicator;
30 IBOutlet UIBarButtonItem* _bbiHostAndStatus;
31 IBOutlet UIButton* _barBtnKeyboard;
32 IBOutlet UIButton* _barBtnNavigation;
33 IBOutlet UIButton* _barBtnMiddleMouse;
34 IBOutlet UIButton* _barBtnRightMouse;
35 IBOutlet UILongPressGestureRecognizer* _longPressRecognizer;
36 IBOutlet UIPanGestureRecognizer* _panRecognizer;
37 IBOutlet UIPanGestureRecognizer* _threeFingerPanRecognizer;
38 IBOutlet UIPinchGestureRecognizer* _pinchRecognizer;
39 IBOutlet UITapGestureRecognizer* _singleTapRecognizer;
40 IBOutlet UITapGestureRecognizer* _twoFingerTapRecognizer;
41 IBOutlet UITapGestureRecognizer* _threeFingerTapRecognizer;
42 IBOutlet UIToolbar* _viewToolbar;
43 IBOutlet UIToolbar* _viewHiddenToolbar;
44
45 KeyInput* _keyEntryView;
46 NSTimer* _updateDisplayTimer;
47
48 // The GLES2 context being drawn too.
49 EAGLContext* _context;
50
51 // The draw surface is a triangle strip (triangles defined by the intersecting
52 // vertexs) to create a rectangle surface.
53 // 1****3
54 // | / |
55 // | / |
56 // 2****4
57 // This also determines the resolution of our surface, being a unit (NxN) grid
58 // with finite divisions. For our surface N = 1, and the number of divisions
59 // respects the CLIENT's desktop resolution.
60 TexturedQuad _quad;
61 // The draw surface consists of two layers (GL Textures). The bottom layer is
62 // the desktop of the HOST. The top layer is mostly transparent and is used
63 // to overlay the current cursor.
64 GLuint _textureIds[2];
65
66 // GLKBaseEffect encapsulates the GL Shaders needed to draw at most two
67 // textures |_textureIds| given vectex information |_quad|. As well as
68 // the textures positions and lighting.
69 GLKBaseEffect* _effect;
70 // The possition of the scene is tracked in the prospective of the CLIENT
71 // resolution. The Z-axis is used to track the scale of the render, our scene
72 // never changes position on the Z-axis.
73 GLKVector3 _scenePosition;
74
75 // List of regions and data that have pending draws to a GL Texture
76 ScopedVector<GLRegion> _glRegions;
77 // Lock for |_glRegions|, regions are delivered from HOST on a network thread,
78 // and drawn to a GL Texture from a GL Context thread
79 NSLock* _glBufferLock;
80
81 // The current cursor
82 scoped_ptr<webrtc::MouseCursor> _cursor;
83 BOOL _needCursorRedraw;
84
85 // Lock for |_cursor|, cursor updates are delivered from HOST on a network
86 // thread, and drawn to a GL Texture from a GL Context thread
87 NSLock* _glCursorLock;
88 // Rectangle of the most recent cursor drawn to a GL Texture. On each
89 // successive frame when a new cursor is available this region is cleared on
90 // the GL Texture, so that the GL Texture is completely transparent again, and
91 // the cursor is then redrawn.
92 webrtc::DesktopRect _cursorDrawnToGL;
93
94 // Location of the mouse according to the CLIENT in the prospective of the
95 // HOST resolution
96 webrtc::DesktopVector _mousePosition;
97
98 BOOL _isAnchorRight;
99 BOOL _isAnchorLeft;
100 BOOL _isAnchorTop;
101 BOOL _isAnchorBottom;
102
103 // Descendent controller for the user to enter their PIN for the selected host
104 PinEntryViewController* _pinEntry;
105
106 // Communication channel from CLIENT to HOST
107 ClientController* _controller;
108
109 // Jabber supplied Details for the host being viewed
110 Host* _host;
111 // Authorization agent for the host being viewed
112 GTMOAuth2Authentication* _authorization;
113
114 // Cache of the CLIENT's desktop resolution.
115 webrtc::DesktopSize _contentSize;
116 // Cache of the HOST's desktop resolution.
117 webrtc::DesktopSize _frameSize;
118
119 // Indicates that the |_frameSize| has changed, when this happens
120 // |_textureIds| must be re initilized at the new size.
121 BOOL _sizeChanged;
122
123 // You can not change the size of a toolbar, so we rely on the value being
124 // wellknown. When |_viewToolbar| is hidden change this value to zero, when
125 // its shown the value is 40
126 int _toolbarHeight;
127
128 // When a user pans they expect the view to experience accelleration after
129 // they release the pan gesture. We track that velocity vecter as a position
130 // delta factored over the frame rate of the GL Context. Velocity is
131 // accounted as a float.
132 CGPoint _panVelocity;
133 }
134
135 - (void)setHostDetails:(Host*)host
136 authorization:(GTMOAuth2Authentication*)authorization;
137
138 // Zoom in/out
139 - (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender;
140 // Left mouse click, moves cursor
141 - (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender;
142 // Scroll the view in 2d
143 - (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender;
144 // Right mouse click and drag, moves cursor
145 - (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender;
146 // Right mouse click
147 - (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender;
148 // Middle mouse click
149 - (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender;
150 // Show hidden menus. Swipe up for keyboard, swipe down for navigation menu
151 - (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender;
152
153 // Do navigation 'back'
154 - (IBAction)barBtnNavigationBackPressed:(id)sender;
155 // Show keyboard
156 - (IBAction)barBtnKeyboardPressed:(id)sender;
157 // Toggle Toolbar's hidden state
158 - (IBAction)barBtnToolBarHidePressed:(id)sender;
159
160 @end
161
162 #endif // REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698