summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorSiqi LIU <me@siqi.fr>2013-07-26 10:52:41 +0200
committerSiqi LIU <me@siqi.fr>2013-07-26 10:52:59 +0200
commit666fe3e96c6715e455c6ab3e509e5e1c271cf9d9 (patch)
tree2240925960ff731b6b9a69c8f42207abd8e7c87f /ios
parent6be2b0fbf9da9963ac18d33f145e06d684136a26 (diff)
send proper pointer visibility command when touch begins/ ends
Change-Id: I2427f1857ca8189db39c20009103d93b935dd5bb
Diffstat (limited to 'ios')
-rw-r--r--ios/iosremote/iosremote/Communication/CommandTransmitter.h5
-rw-r--r--ios/iosremote/iosremote/Communication/CommandTransmitter.m9
-rw-r--r--ios/iosremote/iosremote/slideShow_vc.m6
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