summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorsiqi <me@siqi.fr>2013-06-04 13:46:30 +0200
committersiqi <me@siqi.fr>2013-06-04 13:49:13 +0200
commit85be4cc4cd33bbc0e9a0d9fe1c362000c972dbdd (patch)
tree76a2066568266b403386649030d27258280392cf /ios
parentee96b94dfb5f7957524f7b3e20eeed44de005b97 (diff)
communication files
Diffstat (limited to 'ios')
-rw-r--r--ios/iosremote/Communication/.DS_Storebin6148 -> 0 bytes
-rw-r--r--ios/iosremote/Communication/Client.h24
-rw-r--r--ios/iosremote/Communication/Client.m139
-rw-r--r--ios/iosremote/Communication/CommunicationManager.h13
-rw-r--r--ios/iosremote/Communication/CommunicationManager.m13
-rw-r--r--ios/iosremote/Communication/Receiver.h13
-rw-r--r--ios/iosremote/Communication/Receiver.m13
-rw-r--r--ios/iosremote/Communication/Server.h23
-rw-r--r--ios/iosremote/Communication/Server.m36
-rw-r--r--ios/iosremote/iosremote.xcodeproj/project.pbxproj34
-rw-r--r--ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard54
-rw-r--r--ios/iosremote/iosremote/libreoffice_sdremoteViewController.h4
-rw-r--r--ios/iosremote/iosremote/libreoffice_sdremoteViewController.m15
-rw-r--r--ios/sdremote/sdremote/Communication/Client.h17
-rw-r--r--ios/sdremote/sdremote/Communication/Client.m117
-rw-r--r--ios/sdremote/sdremote/Communication/CommunicationManager.h13
-rw-r--r--ios/sdremote/sdremote/Communication/CommunicationManager.m13
-rw-r--r--ios/sdremote/sdremote/Communication/Receiver.h13
-rw-r--r--ios/sdremote/sdremote/Communication/Receiver.m13
-rw-r--r--ios/sdremote/sdremote/Communication/Server.h19
-rw-r--r--ios/sdremote/sdremote/Communication/Server.m36
-rw-r--r--ios/sdremote/sdremote/Default-568h@2x.pngbin18594 -> 0 bytes
-rw-r--r--ios/sdremote/sdremote/Default.pngbin6540 -> 0 bytes
-rw-r--r--ios/sdremote/sdremote/Default@2x.pngbin16107 -> 0 bytes
-rw-r--r--ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h15
-rw-r--r--ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m46
-rw-r--r--ios/sdremote/sdremote/libreoffice_sdremoteViewController.h15
-rw-r--r--ios/sdremote/sdremote/libreoffice_sdremoteViewController.m35
-rw-r--r--ios/sdremote/sdremote/main.m18
-rw-r--r--ios/sdremote/sdremote/sdremote-Info.plist49
-rw-r--r--ios/sdremote/sdremote/sdremote-Prefix.pch14
31 files changed, 103 insertions, 711 deletions
diff --git a/ios/iosremote/Communication/.DS_Store b/ios/iosremote/Communication/.DS_Store
deleted file mode 100644
index bbb5276d7d0d..000000000000
--- a/ios/iosremote/Communication/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/ios/iosremote/Communication/Client.h b/ios/iosremote/Communication/Client.h
deleted file mode 100644
index 3827b2f33a8a..000000000000
--- a/ios/iosremote/Communication/Client.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//
-// Client.h
-//
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-#import "Server.h"
-#import "CommunicationManager.h"
-#import "Receiver.h"
-
-@interface Client : NSObject
-
--(void) connect;
-
-- (id) initWithServer:(Server*)server
- managedBy:(CommunicationManager*)manager
- interpretedBy:(Receiver*)receiver;
-
--(void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode;
-
-@end \ No newline at end of file
diff --git a/ios/iosremote/Communication/Client.m b/ios/iosremote/Communication/Client.m
deleted file mode 100644
index b90c9d983a47..000000000000
--- a/ios/iosremote/Communication/Client.m
+++ /dev/null
@@ -1,139 +0,0 @@
-//
-// Client.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Client.h"
-#import "Server.h"
-#import "Receiver.h"
-#import "CommunicationManager.h"
-
-@interface Client() <NSStreamDelegate>
-
-@property (nonatomic, strong) NSInputStream* mInputStream;
-@property (nonatomic, strong) NSOutputStream* mOutputStream;
-
-@property (nonatomic, strong) NSString* mPin;
-@property (nonatomic, strong) NSString* mName;
-@property uint mPort;
-
-@property (nonatomic, weak) Server* mServer;
-@property (nonatomic, weak) Receiver* mReceiver;
-@property (nonatomic, weak) CommunicationManager* mComManager;
-
-@property (nonatomic, retain) NSMutableData* mData;
-
-@property BOOL mReady;
-
-@end
-
-
-
-@implementation Client
-
-@synthesize mInputStream = _mInputStream;
-@synthesize mOutputStream = _mOutputStream;
-@synthesize mPin = _mPin;
-@synthesize mName = _mName;
-@synthesize mServer = _mServer;
-@synthesize mComManager = _mComManager;
-@synthesize mData = _mData;
-@synthesize mReady = _mReady;
-
-NSString * const CHARSET = @"UTF-8";
-
-- (id) initWithServer:(Server*)server
- managedBy:(CommunicationManager*)manager
- interpretedBy:(Receiver*)receiver
-{
- self.mPin = @"";
- self.mName = server.serverName;
- self.mComManager = manager;
- self.mReceiver = receiver;
- // hardcoded here to test the communication TODO
- self.mPort = 1599;
-
- return self;
-}
-
-- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
-{
- NSLog(@"Connecting to %@:%u", ip, portNumber);
- CFReadStreamRef readStream;
- CFWriteStreamRef writeStream;
- CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
-
- if(readStream && writeStream)
- {
- CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
- CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-
- //Setup mInputStream
- self.mInputStream = (__bridge NSInputStream *)readStream;
- [self.mInputStream setDelegate:self];
- [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
- [self.mInputStream open];
-
- //Setup outputstream
- self.mOutputStream = (__bridge NSOutputStream *)writeStream;
- [self.mOutputStream setDelegate:self];
- [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
- [self.mOutputStream open];
- }
- NSLog(@"Connected");
-}
-
-- (void) sendCommand:(NSString *)aCommand
-{
- // UTF-8 as speficied in specification
- NSData * data = [aCommand dataUsingEncoding:NSUTF8StringEncoding];
-
- [self.mOutputStream write:(uint8_t *)[data bytes] maxLength:[data length]];
-}
-
-- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
-
- switch(eventCode) {
- case NSStreamEventHasBytesAvailable:
- {
- if(!self.mData) {
- self.mData = [NSMutableData data];
- }
- uint8_t buf[1024];
- unsigned int len = 0;
- len = [(NSInputStream *)stream read:buf maxLength:1024];
- if(len) {
- [self.mData appendBytes:(const void *)buf length:len];
- int bytesRead = 0;
- // bytesRead is an instance variable of type NSNumber.
- bytesRead += len;
- } else {
- NSLog(@"No data but received event for whatever reasons!");
- }
-
- NSString *str = [[NSString alloc] initWithData:self.mData
- encoding:NSUTF8StringEncoding];
- NSLog(@"Data Received: %@", str);
-
- self.mData = nil;
- } break;
- default:
- {
-
- }
-
- }
-}
-
-
-- (void) connect
-{
- [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
-}
-
-
-
-@end
diff --git a/ios/iosremote/Communication/CommunicationManager.h b/ios/iosremote/Communication/CommunicationManager.h
deleted file mode 100644
index d649e3c55beb..000000000000
--- a/ios/iosremote/Communication/CommunicationManager.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// CommunicationManager.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface CommunicationManager : NSObject
-
-@end
diff --git a/ios/iosremote/Communication/CommunicationManager.m b/ios/iosremote/Communication/CommunicationManager.m
deleted file mode 100644
index c91b2f5e2ae6..000000000000
--- a/ios/iosremote/Communication/CommunicationManager.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// CommunicationManager.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "CommunicationManager.h"
-
-@implementation CommunicationManager
-
-@end
diff --git a/ios/iosremote/Communication/Receiver.h b/ios/iosremote/Communication/Receiver.h
deleted file mode 100644
index 9889ec749577..000000000000
--- a/ios/iosremote/Communication/Receiver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Receiver.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface Receiver : NSObject
-
-@end
diff --git a/ios/iosremote/Communication/Receiver.m b/ios/iosremote/Communication/Receiver.m
deleted file mode 100644
index 30a48c675d68..000000000000
--- a/ios/iosremote/Communication/Receiver.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Receiver.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Receiver.h"
-
-@implementation Receiver
-
-@end
diff --git a/ios/iosremote/Communication/Server.h b/ios/iosremote/Communication/Server.h
deleted file mode 100644
index 1cf483dd64b0..000000000000
--- a/ios/iosremote/Communication/Server.h
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Server.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef enum protocol {NETWORK} Protocol_t;
-
-@interface Server : NSObject
-
-@property (nonatomic) Protocol_t protocol;
-@property (nonatomic, strong) NSString* serverName;
-@property (nonatomic, strong) NSString* serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
- atAddress:(NSString*) address
- ofName:(NSString*) name;
-
-@end
diff --git a/ios/iosremote/Communication/Server.m b/ios/iosremote/Communication/Server.m
deleted file mode 100644
index d7bf1adcf00c..000000000000
--- a/ios/iosremote/Communication/Server.m
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Server.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Server.h"
-
-@interface Server()
-
-@end
-
-@implementation Server
-
-@synthesize protocol = _protocol;
-@synthesize serverName = _serverName;
-@synthesize serverAddress = _serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
- atAddress:(NSString*) address
- ofName:(NSString*) name
-{
- self = [self init];
- self.protocol = protocal;
- self.serverAddress = address;
- self.serverName = name;
- return self;
-}
-
-- (NSString *)description{
- return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
-}
-
-@end
diff --git a/ios/iosremote/iosremote.xcodeproj/project.pbxproj b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
index 4a2aaa50217e..bcb64f49d677 100644
--- a/ios/iosremote/iosremote.xcodeproj/project.pbxproj
+++ b/ios/iosremote/iosremote.xcodeproj/project.pbxproj
@@ -19,6 +19,10 @@
57C6E40C175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40A175E06E800E8BC5F /* MainStoryboard_iPhone.storyboard */; };
57C6E40F175E06E800E8BC5F /* MainStoryboard_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 57C6E40D175E06E800E8BC5F /* MainStoryboard_iPad.storyboard */; };
57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */; };
+ 57C6E42E175E076900E8BC5F /* Client.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E427175E076900E8BC5F /* Client.m */; };
+ 57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E429175E076900E8BC5F /* CommunicationManager.m */; };
+ 57C6E430175E076900E8BC5F /* Receiver.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42B175E076900E8BC5F /* Receiver.m */; };
+ 57C6E431175E076900E8BC5F /* Server.m in Sources */ = {isa = PBXBuildFile; fileRef = 57C6E42D175E076900E8BC5F /* Server.m */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
@@ -39,6 +43,14 @@
57C6E40E175E06E800E8BC5F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_iPad.storyboard; sourceTree = "<group>"; };
57C6E410175E06E800E8BC5F /* libreoffice_sdremoteViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = libreoffice_sdremoteViewController.h; sourceTree = "<group>"; };
57C6E411175E06E800E8BC5F /* libreoffice_sdremoteViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = libreoffice_sdremoteViewController.m; sourceTree = "<group>"; };
+ 57C6E426175E076900E8BC5F /* Client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Client.h; path = ../iosremote/Communication/Client.h; sourceTree = "<group>"; };
+ 57C6E427175E076900E8BC5F /* Client.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Client.m; path = ../iosremote/Communication/Client.m; sourceTree = "<group>"; };
+ 57C6E428175E076900E8BC5F /* CommunicationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommunicationManager.h; path = ../iosremote/Communication/CommunicationManager.h; sourceTree = "<group>"; };
+ 57C6E429175E076900E8BC5F /* CommunicationManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CommunicationManager.m; path = ../iosremote/Communication/CommunicationManager.m; sourceTree = "<group>"; };
+ 57C6E42A175E076900E8BC5F /* Receiver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Receiver.h; path = ../iosremote/Communication/Receiver.h; sourceTree = "<group>"; };
+ 57C6E42B175E076900E8BC5F /* Receiver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Receiver.m; path = ../iosremote/Communication/Receiver.m; sourceTree = "<group>"; };
+ 57C6E42C175E076900E8BC5F /* Server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Server.h; path = ../iosremote/Communication/Server.h; sourceTree = "<group>"; };
+ 57C6E42D175E076900E8BC5F /* Server.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Server.m; path = ../iosremote/Communication/Server.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -58,6 +70,7 @@
57C6E3E6175E06E800E8BC5F = {
isa = PBXGroup;
children = (
+ 57C6E425175E076900E8BC5F /* Communication */,
57C6E3F8175E06E800E8BC5F /* iosremote */,
57C6E3F1175E06E800E8BC5F /* Frameworks */,
57C6E3F0175E06E800E8BC5F /* Products */,
@@ -110,6 +123,21 @@
name = "Supporting Files";
sourceTree = "<group>";
};
+ 57C6E425175E076900E8BC5F /* Communication */ = {
+ isa = PBXGroup;
+ children = (
+ 57C6E426175E076900E8BC5F /* Client.h */,
+ 57C6E427175E076900E8BC5F /* Client.m */,
+ 57C6E428175E076900E8BC5F /* CommunicationManager.h */,
+ 57C6E429175E076900E8BC5F /* CommunicationManager.m */,
+ 57C6E42A175E076900E8BC5F /* Receiver.h */,
+ 57C6E42B175E076900E8BC5F /* Receiver.m */,
+ 57C6E42C175E076900E8BC5F /* Server.h */,
+ 57C6E42D175E076900E8BC5F /* Server.m */,
+ );
+ path = Communication;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -181,6 +209,10 @@
57C6E3FF175E06E800E8BC5F /* main.m in Sources */,
57C6E403175E06E800E8BC5F /* libreoffice_sdremoteAppDelegate.m in Sources */,
57C6E412175E06E800E8BC5F /* libreoffice_sdremoteViewController.m in Sources */,
+ 57C6E42E175E076900E8BC5F /* Client.m in Sources */,
+ 57C6E42F175E076900E8BC5F /* CommunicationManager.m in Sources */,
+ 57C6E430175E076900E8BC5F /* Receiver.m in Sources */,
+ 57C6E431175E076900E8BC5F /* Server.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -278,6 +310,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
@@ -289,6 +322,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "iosremote/iosremote-Prefix.pch";
INFOPLIST_FILE = "iosremote/iosremote-Info.plist";
+ IPHONEOS_DEPLOYMENT_TARGET = 5.1;
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
diff --git a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
index 683f452fa7c3..7796088d1d4e 100644
--- a/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
+++ b/ios/iosremote/iosremote/en.lproj/MainStoryboard_iPad.storyboard
@@ -1,23 +1,69 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="2519" systemVersion="12A206j" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="2">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="2.0" toolsVersion="3084" systemVersion="12D78" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" initialViewController="KFV-Ae-zm8">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1856"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="2083"/>
</dependencies>
<scenes>
- <!--class Prefix:identifier View Controller-->
+ <!--Libreoffice sdremote View Controller-->
<scene sceneID="4">
<objects>
<viewController id="2" customClass="libreoffice_sdremoteViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="5">
- <rect key="frame" x="0.0" y="20" width="768" height="1004"/>
+ <rect key="frame" x="0.0" y="64" width="768" height="960"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="IP Address" borderStyle="roundedRect" minimumFontSize="17" id="9w1-Ym-HcF">
+ <rect key="frame" x="234" y="402" width="301" height="30"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <fontDescription key="fontDescription" type="system" pointSize="14"/>
+ <textInputTraits key="textInputTraits"/>
+ </textField>
+ </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
+ <navigationItem key="navigationItem" id="7ye-Vv-ZD0">
+ <barButtonItem key="rightBarButtonItem" title="Connect" id="ZJB-Ei-Sa9">
+ <connections>
+ <action selector="connectToServer:" destination="2" id="58D-7s-OuE"/>
+ </connections>
+ </barButtonItem>
+ </navigationItem>
+ <connections>
+ <outlet property="ipAddressTextEdit" destination="9w1-Ym-HcF" id="hab-JH-3Lf"/>
+ </connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="3" sceneMemberID="firstResponder"/>
</objects>
+ <point key="canvasLocation" x="1618" y="-293"/>
+ </scene>
+ <!--Navigation Controller-->
+ <scene sceneID="00H-XM-3gJ">
+ <objects>
+ <navigationController id="KFV-Ae-zm8" sceneMemberID="viewController">
+ <toolbarItems/>
+ <navigationBar key="navigationBar" contentMode="scaleToFill" id="QnQ-yW-KgX">
+ <rect key="frame" x="0.0" y="0.0" width="768" height="44"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </navigationBar>
+ <nil name="viewControllers"/>
+ <connections>
+ <segue destination="2" kind="relationship" relationship="rootViewController" id="nce-OO-TOv"/>
+ </connections>
+ </navigationController>
+ <placeholder placeholderIdentifier="IBFirstResponder" id="sOJ-6b-jVh" userLabel="First Responder" sceneMemberID="firstResponder"/>
+ </objects>
+ <point key="canvasLocation" x="721" y="-301"/>
</scene>
</scenes>
+ <classes>
+ <class className="libreoffice_sdremoteViewController" superclassName="UIViewController">
+ <source key="sourceIdentifier" type="project" relativePath="./Classes/libreoffice_sdremoteViewController.h"/>
+ <relationships>
+ <relationship kind="action" name="connectToServer:"/>
+ <relationship kind="outlet" name="ipAddressTextEdit" candidateClass="UITextField"/>
+ </relationships>
+ </class>
+ </classes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackTranslucent"/>
<simulatedOrientationMetrics key="orientation"/>
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
index 695964bd8610..fdeaf69abe02 100644
--- a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.h
@@ -10,4 +10,8 @@
@interface libreoffice_sdremoteViewController : UIViewController
+- (IBAction)connectToServer:(id)sender;
+
+@property (weak, nonatomic) IBOutlet UITextField *ipAddressTextEdit;
+
@end
diff --git a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
index d6af7fe90a6d..823c7039aaed 100644
--- a/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
+++ b/ios/iosremote/iosremote/libreoffice_sdremoteViewController.m
@@ -7,6 +7,8 @@
//
#import "libreoffice_sdremoteViewController.h"
+#import "Server.h"
+#import "Client.h"
@interface libreoffice_sdremoteViewController ()
@@ -26,4 +28,17 @@
// Dispose of any resources that can be recreated.
}
+
+- (IBAction)connectToServer:(id)sender {
+ NSString * address = [self.ipAddressTextEdit text];
+ Server * server = [[Server alloc] initWithProtocol:NETWORK atAddress:address ofName:@"Server"];
+ Client * client = [[Client alloc] initWithServer:server managedBy:nil interpretedBy:nil];
+ [client connect];
+}
+
+
+- (void)viewDidUnload {
+ [self setIpAddressTextEdit:nil];
+ [super viewDidUnload];
+}
@end
diff --git a/ios/sdremote/sdremote/Communication/Client.h b/ios/sdremote/sdremote/Communication/Client.h
deleted file mode 100644
index 03a7a5a5d1ee..000000000000
--- a/ios/sdremote/sdremote/Communication/Client.h
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Client.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface Client : NSObject <NSStreamDelegate>
-
-
-+(void) connect;
-
-
-@end \ No newline at end of file
diff --git a/ios/sdremote/sdremote/Communication/Client.m b/ios/sdremote/sdremote/Communication/Client.m
deleted file mode 100644
index c48ec12770d2..000000000000
--- a/ios/sdremote/sdremote/Communication/Client.m
+++ /dev/null
@@ -1,117 +0,0 @@
-//
-// Client.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Client.h"
-#import "Server.h"
-#import "Receiver.h"
-#import "CommunicationManager.h"
-
-@interface Client()
-
-@property (nonatomic, strong) NSInputStream* mInputStream;
-@property (nonatomic, strong) NSOutputStream* mOutputStream;
-
-@property (nonatomic, strong) NSString* mPin;
-@property (nonatomic, strong) NSString* mName;
-@property const uint mPort;
-
-@property (nonatomic, weak) Server* mServer;
-@property (nonatomic, weak) Receiver* mReceiver;
-@property (nonatomic, weak) CommunicationManager* mComManager;
-
-@property (nonatomic, retain) NSMutableData* mData;
-
-@end
-
-
-
-@implementation Client
-
-@synthesize mInputStream = _mInputStream;
-@synthesize mOutputStream = _mOutputStream;
-@synthesize mPin = _mPin;
-@synthesize mName = _mName;
-@synthesize mServer = _mServer;
-@synthesize mComManager = _mComManager;
-@synthesize mData = _mData;
-
-NSString * const CHARSET = @"UTF-8";
-
-- (id) initWithServer:(Server*)server
- managedBy:(CommunicationManager*)manager
- interpretedBy:(Receiver*)receiver
-{
- self.mPin = @"";
- self.mName = server.serverName;
- self.mComManager = manager;
- self.mReceiver = receiver;
- // hardcoded here to test the communication TODO
- self.mPort = 1599;
-
- return self;
-}
-
-- (void)streamOpenWithIp:(NSString *)ip withPortNumber:(uint)portNumber
-{
- CFReadStreamRef readStream;
- CFWriteStreamRef writeStream;
- CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)ip, portNumber, &readStream, &writeStream);
-
- if(readStream && writeStream)
- {
- CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
- CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-
- //Setup mInputStream
- self.mInputStream = (__bridge NSInputStream *)readStream;
- [self.mInputStream setDelegate:self];
- [self.mInputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
- [self.mInputStream open];
-
- //Setup outputstream
- self.mOutputStream = (__bridge NSOutputStream *)writeStream;
- [self.mOutputStream setDelegate:self];
- [self.mOutputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
- [self.mOutputStream open];
- }
-}
-
-- (void)stream:(NSStream *)stream handleEvent:(NSStreamEvent)eventCode {
-
- switch(eventCode) {
- case NSStreamEventHasBytesAvailable:
- {
- if(!self.mData) {
- self.mData = [NSMutableData data];
- }
- uint8_t buf[1024];
- unsigned int len = 0;
- len = [(NSInputStream *)stream read:buf maxLength:1024];
- if(len) {
- [self.mData appendBytes:(const void *)buf length:len];
- // bytesRead is an instance variable of type NSNumber.
- [bytesRead setIntValue:[bytesRead intValue]+len];
- } else {
- NSLog(@"no buffer!");
- }
- break;
- }
-
- }
-}
-
-
-- (void) connect
-{
- [self streamOpenWithIp:self.mServer.serverAddress withPortNumber:self.mPort];
-
-}
-
-
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.h b/ios/sdremote/sdremote/Communication/CommunicationManager.h
deleted file mode 100644
index d649e3c55beb..000000000000
--- a/ios/sdremote/sdremote/Communication/CommunicationManager.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// CommunicationManager.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface CommunicationManager : NSObject
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/CommunicationManager.m b/ios/sdremote/sdremote/Communication/CommunicationManager.m
deleted file mode 100644
index c91b2f5e2ae6..000000000000
--- a/ios/sdremote/sdremote/Communication/CommunicationManager.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// CommunicationManager.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "CommunicationManager.h"
-
-@implementation CommunicationManager
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.h b/ios/sdremote/sdremote/Communication/Receiver.h
deleted file mode 100644
index 9889ec749577..000000000000
--- a/ios/sdremote/sdremote/Communication/Receiver.h
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Receiver.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-@interface Receiver : NSObject
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/Receiver.m b/ios/sdremote/sdremote/Communication/Receiver.m
deleted file mode 100644
index 30a48c675d68..000000000000
--- a/ios/sdremote/sdremote/Communication/Receiver.m
+++ /dev/null
@@ -1,13 +0,0 @@
-//
-// Receiver.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Receiver.h"
-
-@implementation Receiver
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/Server.h b/ios/sdremote/sdremote/Communication/Server.h
deleted file mode 100644
index 2cf720e5fba2..000000000000
--- a/ios/sdremote/sdremote/Communication/Server.h
+++ /dev/null
@@ -1,19 +0,0 @@
-//
-// Server.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <Foundation/Foundation.h>
-
-typedef enum protocol {NETWORK} Protocol_t;
-
-@interface Server : NSObject
-
-@property (nonatomic) Protocol_t protocol;
-@property (nonatomic, strong) NSString* serverName;
-@property (nonatomic, strong) NSString* serverAddress;
-
-@end
diff --git a/ios/sdremote/sdremote/Communication/Server.m b/ios/sdremote/sdremote/Communication/Server.m
deleted file mode 100644
index d7bf1adcf00c..000000000000
--- a/ios/sdremote/sdremote/Communication/Server.m
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// Server.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "Server.h"
-
-@interface Server()
-
-@end
-
-@implementation Server
-
-@synthesize protocol = _protocol;
-@synthesize serverName = _serverName;
-@synthesize serverAddress = _serverAddress;
-
-- (id)initWithProtocol:(Protocol_t)protocal
- atAddress:(NSString*) address
- ofName:(NSString*) name
-{
- self = [self init];
- self.protocol = protocal;
- self.serverAddress = address;
- self.serverName = name;
- return self;
-}
-
-- (NSString *)description{
- return [NSString stringWithFormat:@"Server: Name:%@ Addr:%@", self.serverName, self.serverAddress];
-}
-
-@end
diff --git a/ios/sdremote/sdremote/Default-568h@2x.png b/ios/sdremote/sdremote/Default-568h@2x.png
deleted file mode 100644
index 0891b7aabfcf..000000000000
--- a/ios/sdremote/sdremote/Default-568h@2x.png
+++ /dev/null
Binary files differ
diff --git a/ios/sdremote/sdremote/Default.png b/ios/sdremote/sdremote/Default.png
deleted file mode 100644
index 4c8ca6f693f9..000000000000
--- a/ios/sdremote/sdremote/Default.png
+++ /dev/null
Binary files differ
diff --git a/ios/sdremote/sdremote/Default@2x.png b/ios/sdremote/sdremote/Default@2x.png
deleted file mode 100644
index 35b84cffeb4d..000000000000
--- a/ios/sdremote/sdremote/Default@2x.png
+++ /dev/null
Binary files differ
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
deleted file mode 100644
index 2d168765671d..000000000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// libreoffice_sdremoteAppDelegate.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface libreoffice_sdremoteAppDelegate : UIResponder <UIApplicationDelegate>
-
-@property (strong, nonatomic) UIWindow *window;
-
-@end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m b/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
deleted file mode 100644
index 2e13f912e51c..000000000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteAppDelegate.m
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// libreoffice_sdremoteAppDelegate.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "libreoffice_sdremoteAppDelegate.h"
-
-@implementation libreoffice_sdremoteAppDelegate
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
-{
- // Override point for customization after application launch.
- return YES;
-}
-
-- (void)applicationWillResignActive:(UIApplication *)application
-{
- // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
- // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-}
-
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
- // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
- // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
-}
-
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
- // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
-}
-
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
- // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
-}
-
-- (void)applicationWillTerminate:(UIApplication *)application
-{
- // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
-}
-
-@end
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
deleted file mode 100644
index f120e0f322e7..000000000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//
-// libreoffice_sdremoteViewController.h
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface libreoffice_sdremoteViewController : UIViewController
-@property (weak, nonatomic) IBOutlet UIBarButtonItem *connect;
-
-@end
-
diff --git a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m b/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
deleted file mode 100644
index ed11a7369895..000000000000
--- a/ios/sdremote/sdremote/libreoffice_sdremoteViewController.m
+++ /dev/null
@@ -1,35 +0,0 @@
-//
-// libreoffice_sdremoteViewController.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import "libreoffice_sdremoteViewController.h"
-
-@interface libreoffice_sdremoteViewController ()
-
-@end
-
-@implementation libreoffice_sdremoteViewController
-
-- (void)viewDidLoad
-{
- [super viewDidLoad];
-
-
- // Do any additional setup after loading the view, typically from a nib.
-}
-
-- (void)didReceiveMemoryWarning
-{
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
-}
-
-- (void)viewDidUnload {
- [self setConnect:nil];
- [super viewDidUnload];
-}
-@end
diff --git a/ios/sdremote/sdremote/main.m b/ios/sdremote/sdremote/main.m
deleted file mode 100644
index 33135deeab02..000000000000
--- a/ios/sdremote/sdremote/main.m
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// main.m
-// sdremote
-//
-// Created by Liu Siqi on 6/3/13.
-// Copyright (c) 2013 libreoffice. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-#import "libreoffice_sdremoteAppDelegate.h"
-
-int main(int argc, char *argv[])
-{
- @autoreleasepool {
- return UIApplicationMain(argc, argv, nil, NSStringFromClass([libreoffice_sdremoteAppDelegate class]));
- }
-}
diff --git a/ios/sdremote/sdremote/sdremote-Info.plist b/ios/sdremote/sdremote/sdremote-Info.plist
deleted file mode 100644
index f2b1ca676dd1..000000000000
--- a/ios/sdremote/sdremote/sdremote-Info.plist
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>en</string>
- <key>CFBundleDisplayName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>org.libreoffice.${PRODUCT_NAME:rfc1034identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleShortVersionString</key>
- <string>1.0</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>LSRequiresIPhoneOS</key>
- <true/>
- <key>UIMainStoryboardFile</key>
- <string>MainStoryboard_iPhone</string>
- <key>UIMainStoryboardFile~ipad</key>
- <string>MainStoryboard_iPad</string>
- <key>UIRequiredDeviceCapabilities</key>
- <array>
- <string>armv7</string>
- </array>
- <key>UISupportedInterfaceOrientations</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
- <key>UISupportedInterfaceOrientations~ipad</key>
- <array>
- <string>UIInterfaceOrientationPortrait</string>
- <string>UIInterfaceOrientationPortraitUpsideDown</string>
- <string>UIInterfaceOrientationLandscapeLeft</string>
- <string>UIInterfaceOrientationLandscapeRight</string>
- </array>
-</dict>
-</plist>
diff --git a/ios/sdremote/sdremote/sdremote-Prefix.pch b/ios/sdremote/sdremote/sdremote-Prefix.pch
deleted file mode 100644
index 5f37a4d23f23..000000000000
--- a/ios/sdremote/sdremote/sdremote-Prefix.pch
+++ /dev/null
@@ -1,14 +0,0 @@
-//
-// Prefix header for all source files of the 'sdremote' target in the 'sdremote' project
-//
-
-#import <Availability.h>
-
-#ifndef __IPHONE_5_0
-#warning "This project uses features only available in iOS SDK 5.0 and later."
-#endif
-
-#ifdef __OBJC__
- #import <UIKit/UIKit.h>
- #import <Foundation/Foundation.h>
-#endif