diff options
Diffstat (limited to 'ios')
-rw-r--r-- | ios/iosremote/iosremote/Communication/CommandTransmitter.h | 5 | ||||
-rw-r--r-- | ios/iosremote/iosremote/Communication/CommandTransmitter.m | 9 | ||||
-rw-r--r-- | ios/iosremote/iosremote/slideShow_vc.m | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/ios/iosremote/iosremote/Communication/CommandTransmitter.h b/ios/iosremote/iosremote/Communication/CommandTransmitter.h index f0243b3d7e3e..b93cf7b1b5e3 100644 --- a/ios/iosremote/iosremote/Communication/CommandTransmitter.h +++ b/ios/iosremote/iosremote/Communication/CommandTransmitter.h @@ -27,6 +27,11 @@ - (void) startPresentation; - (void) stopPresentation; +// Update pointer position - (void) pointerCoordination:(CGPoint) aPoint; +// Set pointer to the proper position and set it to visible on screen. +- (void) setPointerVisibleAt: (CGPoint)aPoint; +// Dismiss the pointer when touch ended. +- (void) setPointerDismissed; @end diff --git a/ios/iosremote/iosremote/Communication/CommandTransmitter.m b/ios/iosremote/iosremote/Communication/CommandTransmitter.m index 07cdc9a8df09..111c1ec68503 100644 --- a/ios/iosremote/iosremote/Communication/CommandTransmitter.m +++ b/ios/iosremote/iosremote/Communication/CommandTransmitter.m @@ -48,6 +48,15 @@ [self.client sendCommand:[NSString stringWithFormat:@"pointer_coordination\n%f\n%f\n\n", aPoint.x, aPoint.y]]; } +- (void) setPointerVisibleAt: (CGPoint)aPoint +{ + [self.client sendCommand:[NSString stringWithFormat:@"pointer_started\n%f\n%f\n\n", aPoint.x, aPoint.y]]; +} + +- (void) setPointerDismissed +{ + [self.client sendCommand:@"pointer_dismissed\n\n"]; +} /** * Blank the screen to the default colour (set server-side), which is diff --git a/ios/iosremote/iosremote/slideShow_vc.m b/ios/iosremote/iosremote/slideShow_vc.m index f66e2794f6d7..5fb3350ea113 100644 --- a/ios/iosremote/iosremote/slideShow_vc.m +++ b/ios/iosremote/iosremote/slideShow_vc.m @@ -191,6 +191,11 @@ CGPoint loc = [touch locationInView:self.touchPointerImage]; if (loc.x >= 0 && loc.x <= self.touchPointerImage.frame.size.width && loc.y >= 0 && loc.y <= self.touchPointerImage.frame.size.height){ + CGPoint pointerInPercentage; + pointerInPercentage.x = loc.x / self.touchPointerImage.frame.size.width; + pointerInPercentage.y = loc.y / self.touchPointerImage.frame.size.height; + [self.comManager.transmitter setPointerVisibleAt:pointerInPercentage]; + CGPoint p; p.x = loc.x + self.touchPointerImage.frame.origin.x; p.y = loc.y + self.touchPointerImage.frame.origin.y; @@ -230,6 +235,7 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { [self.movingPointer setHidden:YES]; + [self.comManager.transmitter setPointerDismissed]; } #pragma mark - System defaults |