Index: remoting/client/ios/app/host_view_controller.mm |
diff --git a/remoting/client/ios/app/host_view_controller.mm b/remoting/client/ios/app/host_view_controller.mm |
index bd8fa39c6c7da3c403e3cd38aaaaa005143cdd3a..76187ef0be14a14b7cf09c5df45c139456b41b80 100644 |
--- a/remoting/client/ios/app/host_view_controller.mm |
+++ b/remoting/client/ios/app/host_view_controller.mm |
@@ -8,10 +8,14 @@ |
#import "remoting/client/ios/app/host_view_controller.h" |
+#include <memory> |
+ |
#import <GLKit/GLKit.h> |
+#include "remoting/client/gesture_interpreter.h" |
+ |
#import "ios/third_party/material_components_ios/src/components/Buttons/src/MaterialButtons.h" |
-#import "remoting/client/ios/display/gl_display_handler.h" |
+#import "remoting/client/ios/client_gestures.h" |
#import "remoting/client/ios/session/remoting_client.h" |
static const CGFloat kFabInset = 15.f; |
@@ -19,6 +23,8 @@ static const CGFloat kFabInset = 15.f; |
@interface HostViewController () { |
RemotingClient* _client; |
MDCFloatingButton* _floatingButton; |
+ |
+ ClientGestures* _clientGestures; |
} |
@end |
@@ -76,25 +82,40 @@ static const CGFloat kFabInset = 15.f; |
- (void)viewWillAppear:(BOOL)animated { |
[super viewWillAppear:animated]; |
- ((GLKView*)self.view).enableSetNeedsDisplay = true; |
+ |
+ _client.displayHandler.delegate = self; |
+ |
+ _clientGestures = |
+ [[ClientGestures alloc] initWithView:self.view client:_client]; |
} |
- (void)viewWillDisappear:(BOOL)animated { |
[super viewWillDisappear:animated]; |
+ |
+ _clientGestures = nil; |
} |
- (void)viewDidLayoutSubviews { |
[super viewDidLayoutSubviews]; |
- [_client.displayHandler onSurfaceChanged:((GLKView*)self.view).frame]; |
+ CGRect surfaceFrame = self.view.frame; |
+ [_client.displayHandler onSurfaceChanged:surfaceFrame]; |
nicholss
2017/05/03 22:47:35
Maybe we could tell the client that the surface ch
Yuwei
2017/05/04 00:28:07
Done.
|
+ _client.gestureInterpreter->OnSurfaceSizeChanged(surfaceFrame.size.width, |
+ surfaceFrame.size.height); |
- const CGSize& btnSize = _floatingButton.frame.size; |
+ CGSize btnSize = _floatingButton.frame.size; |
_floatingButton.frame = |
CGRectMake(self.view.frame.size.width - btnSize.width - kFabInset, |
self.view.frame.size.height - btnSize.height - kFabInset, |
btnSize.width, btnSize.height); |
} |
+#pragma mark - GlDisplayHandlerDelegate |
+ |
+- (void)canvasSizeChanged:(CGSize)size { |
+ _client.gestureInterpreter->OnDesktopSizeChanged(size.width, size.height); |
nicholss
2017/05/03 22:47:35
Do we still need the host view controller to tell
Yuwei
2017/05/04 00:28:07
Nope. Move delegate to RemotingClient instead.
|
+} |
+ |
#pragma mark - Private |
- (void)didTap:(id)sender { |