| Index: remoting/ios/ui/host_view_controller.h
|
| diff --git a/remoting/ios/ui/host_view_controller.h b/remoting/ios/ui/host_view_controller.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..05afd0b71393dc460ce1a3f14423cfa0ee1872cf
|
| --- /dev/null
|
| +++ b/remoting/ios/ui/host_view_controller.h
|
| @@ -0,0 +1,162 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
|
| +#define REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
|
| +
|
| +#import <GLKit/GLKit.h>
|
| +
|
| +#import "GTMOAuth2Authentication.h"
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/scoped_vector.h"
|
| +#include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h"
|
| +
|
| +#import "remoting/ios/host.h"
|
| +#import "remoting/ios/key_input.h"
|
| +#import "remoting/ios/utility.h"
|
| +#import "remoting/ios/bridge/client_controller.h"
|
| +#import "remoting/ios/ui/pin_entry_view_controller.h"
|
| +
|
| +@interface HostViewController
|
| + : GLKViewController<PinEntryViewControllerDelegate,
|
| + KeyInputDelegate,
|
| + ClientControllerDelegate,
|
| + UIGestureRecognizerDelegate,
|
| + UIToolbarDelegate> {
|
| + @private
|
| + IBOutlet UIActivityIndicatorView* _busyIndicator;
|
| + IBOutlet UIBarButtonItem* _bbiHostAndStatus;
|
| + IBOutlet UIButton* _barBtnKeyboard;
|
| + IBOutlet UIButton* _barBtnNavigation;
|
| + IBOutlet UIButton* _barBtnMiddleMouse;
|
| + IBOutlet UIButton* _barBtnRightMouse;
|
| + IBOutlet UILongPressGestureRecognizer* _longPressRecognizer;
|
| + IBOutlet UIPanGestureRecognizer* _panRecognizer;
|
| + IBOutlet UIPanGestureRecognizer* _threeFingerPanRecognizer;
|
| + IBOutlet UIPinchGestureRecognizer* _pinchRecognizer;
|
| + IBOutlet UITapGestureRecognizer* _singleTapRecognizer;
|
| + IBOutlet UITapGestureRecognizer* _twoFingerTapRecognizer;
|
| + IBOutlet UITapGestureRecognizer* _threeFingerTapRecognizer;
|
| + IBOutlet UIToolbar* _viewToolbar;
|
| + IBOutlet UIToolbar* _viewHiddenToolbar;
|
| +
|
| + KeyInput* _keyEntryView;
|
| + NSTimer* _updateDisplayTimer;
|
| +
|
| + // The GLES2 context being drawn too.
|
| + EAGLContext* _context;
|
| +
|
| + // The draw surface is a triangle strip (triangles defined by the intersecting
|
| + // vertexs) to create a rectangle surface.
|
| + // 1****3
|
| + // | / |
|
| + // | / |
|
| + // 2****4
|
| + // This also determines the resolution of our surface, being a unit (NxN) grid
|
| + // with finite divisions. For our surface N = 1, and the number of divisions
|
| + // respects the CLIENT's desktop resolution.
|
| + TexturedQuad _quad;
|
| + // The draw surface consists of two layers (GL Textures). The bottom layer is
|
| + // the desktop of the HOST. The top layer is mostly transparent and is used
|
| + // to overlay the current cursor.
|
| + GLuint _textureIds[2];
|
| +
|
| + // GLKBaseEffect encapsulates the GL Shaders needed to draw at most two
|
| + // textures |_textureIds| given vectex information |_quad|. As well as
|
| + // the textures positions and lighting.
|
| + GLKBaseEffect* _effect;
|
| + // The possition of the scene is tracked in the prospective of the CLIENT
|
| + // resolution. The Z-axis is used to track the scale of the render, our scene
|
| + // never changes position on the Z-axis.
|
| + GLKVector3 _scenePosition;
|
| +
|
| + // List of regions and data that have pending draws to a GL Texture
|
| + ScopedVector<GLRegion> _glRegions;
|
| + // Lock for |_glRegions|, regions are delivered from HOST on a network thread,
|
| + // and drawn to a GL Texture from a GL Context thread
|
| + NSLock* _glBufferLock;
|
| +
|
| + // The current cursor
|
| + scoped_ptr<webrtc::MouseCursor> _cursor;
|
| + BOOL _needCursorRedraw;
|
| +
|
| + // Lock for |_cursor|, cursor updates are delivered from HOST on a network
|
| + // thread, and drawn to a GL Texture from a GL Context thread
|
| + NSLock* _glCursorLock;
|
| + // Rectangle of the most recent cursor drawn to a GL Texture. On each
|
| + // successive frame when a new cursor is available this region is cleared on
|
| + // the GL Texture, so that the GL Texture is completely transparent again, and
|
| + // the cursor is then redrawn.
|
| + webrtc::DesktopRect _cursorDrawnToGL;
|
| +
|
| + // Location of the mouse according to the CLIENT in the prospective of the
|
| + // HOST resolution
|
| + webrtc::DesktopVector _mousePosition;
|
| +
|
| + BOOL _isAnchorRight;
|
| + BOOL _isAnchorLeft;
|
| + BOOL _isAnchorTop;
|
| + BOOL _isAnchorBottom;
|
| +
|
| + // Descendent controller for the user to enter their PIN for the selected host
|
| + PinEntryViewController* _pinEntry;
|
| +
|
| + // Communication channel from CLIENT to HOST
|
| + ClientController* _controller;
|
| +
|
| + // Jabber supplied Details for the host being viewed
|
| + Host* _host;
|
| + // Authorization agent for the host being viewed
|
| + GTMOAuth2Authentication* _authorization;
|
| +
|
| + // Cache of the CLIENT's desktop resolution.
|
| + webrtc::DesktopSize _contentSize;
|
| + // Cache of the HOST's desktop resolution.
|
| + webrtc::DesktopSize _frameSize;
|
| +
|
| + // Indicates that the |_frameSize| has changed, when this happens
|
| + // |_textureIds| must be re initilized at the new size.
|
| + BOOL _sizeChanged;
|
| +
|
| + // You can not change the size of a toolbar, so we rely on the value being
|
| + // wellknown. When |_viewToolbar| is hidden change this value to zero, when
|
| + // its shown the value is 40
|
| + int _toolbarHeight;
|
| +
|
| + // When a user pans they expect the view to experience accelleration after
|
| + // they release the pan gesture. We track that velocity vecter as a position
|
| + // delta factored over the frame rate of the GL Context. Velocity is
|
| + // accounted as a float.
|
| + CGPoint _panVelocity;
|
| +}
|
| +
|
| +- (void)setHostDetails:(Host*)host
|
| + authorization:(GTMOAuth2Authentication*)authorization;
|
| +
|
| +// Zoom in/out
|
| +- (IBAction)pinchGestureTriggered:(UIPinchGestureRecognizer*)sender;
|
| +// Left mouse click, moves cursor
|
| +- (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender;
|
| +// Scroll the view in 2d
|
| +- (IBAction)panGestureTriggered:(UIPanGestureRecognizer*)sender;
|
| +// Right mouse click and drag, moves cursor
|
| +- (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender;
|
| +// Right mouse click
|
| +- (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender;
|
| +// Middle mouse click
|
| +- (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender;
|
| +// Show hidden menus. Swipe up for keyboard, swipe down for navigation menu
|
| +- (IBAction)threeFingerPanGestureTriggered:(UIPanGestureRecognizer*)sender;
|
| +
|
| +// Do navigation 'back'
|
| +- (IBAction)barBtnNavigationBackPressed:(id)sender;
|
| +// Show keyboard
|
| +- (IBAction)barBtnKeyboardPressed:(id)sender;
|
| +// Toggle Toolbar's hidden state
|
| +- (IBAction)barBtnToolBarHidePressed:(id)sender;
|
| +
|
| +@end
|
| +
|
| +#endif // REMOTING_IOS_UI_HOST_VIEW_CONTROLLER_H_
|
|
|