diff --git a/Classes/ImagePickerViewController.m b/Classes/ImagePickerViewController.m new file mode 100644 index 000000000..c31e48906 --- /dev/null +++ b/Classes/ImagePickerViewController.m @@ -0,0 +1,177 @@ +/* ImagePickerViewController.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "ImagePickerViewController.h" +#import "PhoneMainView.h" +#import "DTActionSheet.h" + +@implementation ImagePickerViewController + +@synthesize imagePickerDelegate; +@synthesize sourceType; +@synthesize mediaTypes; +@synthesize allowsEditing; + + +#pragma mark - Lifecycle Functions + +- (id)init { + self = [super init]; + if (self != nil) { + pickerController = [[UIImagePickerController alloc] init]; + if([LinphoneManager runningOnIpad]) { + popoverController = [[UIPopoverController alloc] initWithContentViewController:pickerController]; + } + } + return self; +} + +- (void)dealloc { + [pickerController release]; + [popoverController release]; + + [super dealloc]; +} + + +#pragma mark - UICompositeViewDelegate Functions + +static UICompositeViewDescription *compositeDescription = nil; + ++ (UICompositeViewDescription *)compositeViewDescription { + if(compositeDescription == nil) { + compositeDescription = [[UICompositeViewDescription alloc] init:@"ImagePicker" + content:@"ImagePickerViewController" + stateBar:nil + stateBarEnabled:false + tabBar:@"UIMainBar" + tabBarEnabled:true + fullscreen:false + landscapeMode:[LinphoneManager runningOnIpad] + portraitMode:true]; + } + return compositeDescription; +} + + +#pragma mark - ViewController Functions + +- (void)viewDidLoad { + [super viewDidLoad]; + + [self.view setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; + if(popoverController == nil) { + [pickerController.view setFrame:[self.view bounds]]; + [self.view addSubview:[pickerController view]]; + } else { + [popoverController setDelegate:self]; + } + [pickerController setDelegate:self]; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if(popoverController != nil) { + [popoverController presentPopoverFromRect:CGRectZero inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:FALSE]; + } +} + +- (void)viewWillDisappear:(BOOL)animated { + [super viewWillDisappear:animated]; + if(popoverController != nil) { + [popoverController dismissPopoverAnimated: NO]; + } +} + +#pragma mark - Property Functions + +- (BOOL)allowsEditing { + return pickerController.allowsEditing; +} + +- (void)setAllowsEditing:(BOOL)aallowsEditing { + pickerController.allowsEditing = aallowsEditing; +} + +- (UIImagePickerControllerSourceType)sourceType { + return pickerController.sourceType; +} + +- (void)setSourceType:(UIImagePickerControllerSourceType)asourceType { + pickerController.sourceType = asourceType; +} + +- (NSArray *)mediaTypes { + return pickerController.mediaTypes; +} + +- (void)setMediaTypes:(NSArray *)amediaTypes { + pickerController.mediaTypes = amediaTypes; +} + + +#pragma mark - + +- (void)dismiss { + if([[[PhoneMainView instance] currentView] equal:[ImagePickerViewController compositeViewDescription]]) { + [[PhoneMainView instance] popCurrentView]; + } +} + ++ (void)promptSelectSource:(void (^)(UIImagePickerControllerSourceType))block { + DTActionSheet *sheet = [[[DTActionSheet alloc] initWithTitle:NSLocalizedString(@"Select picture source",nil)] autorelease]; + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Camera",nil) block:^(){ + block(UIImagePickerControllerSourceTypeCamera); + }]; + } + if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { + [sheet addButtonWithTitle:NSLocalizedString(@"Photo library",nil) block:^(){ + block(UIImagePickerControllerSourceTypePhotoLibrary); + }]; + } + [sheet addCancelButtonWithTitle:NSLocalizedString(@"Cancel",nil)]; + + [sheet showInView:[PhoneMainView instance].view]; +} + + +#pragma mark - UIImagePickerControllerDelegate Functions + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage]; + if(image == nil) { + image = [info objectForKey:UIImagePickerControllerOriginalImage]; + } + if(image != nil && imagePickerDelegate != nil) { + [imagePickerDelegate imagePickerDelegateImage:image info:info]; + } + [self dismiss]; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + [self dismiss]; +} + +- (BOOL)popoverControllerShouldDismissPopover:(UIPopoverController *)apopoverController { + [self dismiss]; + return TRUE; +} + +@end diff --git a/Classes/ImageSharing.h b/Classes/ImageSharing.h new file mode 100644 index 000000000..5949cc8a6 --- /dev/null +++ b/Classes/ImageSharing.h @@ -0,0 +1,52 @@ +/* ImageSharing.h + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import + +@class ImageSharing; + +@protocol ImageSharingDelegate + +- (void)imageSharingProgress:(ImageSharing*)imageSharing progress:(float)progress; +- (void)imageSharingAborted:(ImageSharing*)imageSharing; +- (void)imageSharingError:(ImageSharing*)imageSharing error:(NSError *)error; +- (void)imageSharingUploadDone:(ImageSharing*)imageSharing url:(NSURL*)url; +- (void)imageSharingDownloadDone:(ImageSharing*)imageSharing image:(UIImage *)image; + +@end + +@interface ImageSharing : NSObject { +@private + NSInteger totalBytesExpectedToRead; + id delegate; + int statusCode; +} + ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate userInfo:(id)userInfo; ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate userInfo:(id)userInfo; + +- (void)cancel; + +@property (nonatomic, retain) id userInfo; + +@property (nonatomic, readonly) BOOL upload; +@property (nonatomic, readonly) NSMutableData* data; +@property (nonatomic, readonly) NSURLConnection* connection; + +@end diff --git a/Classes/ImageSharing.m b/Classes/ImageSharing.m new file mode 100644 index 000000000..403addd20 --- /dev/null +++ b/Classes/ImageSharing.m @@ -0,0 +1,186 @@ +/* ImageSharing.m + * + * Copyright (C) 2012 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "ImageSharing.h" +#import "Utils.h" +#import "LinphoneManager.h" + +@implementation ImageSharing + +@synthesize connection; +@synthesize data; +@synthesize upload; +@synthesize userInfo; + +#pragma mark - Lifecycle Functions + ++ (id)imageSharingUpload:(NSURL*)url image:(UIImage*)image delegate:(id)delegate userInfo:(id)auserInfo{ + ImageSharing *imgs = [[ImageSharing alloc] init]; + if(imgs != nil) { + imgs.userInfo = auserInfo; + imgs->upload = TRUE; + imgs->delegate = [delegate retain]; + imgs->data = [[NSMutableData alloc] init]; + if(delegate) { + [delegate imageSharingProgress:imgs progress:0]; + } + [imgs uploadImageTo:url image:image]; + } + return imgs; +} + ++ (id)imageSharingDownload:(NSURL*)url delegate:(id)delegate userInfo:(id)auserInfo{ + ImageSharing *imgs = [[ImageSharing alloc] init]; + if(imgs != nil) { + imgs.userInfo = auserInfo; + imgs->upload = FALSE; + imgs->delegate = [delegate retain]; + imgs->data = [[NSMutableData alloc] init]; + if(delegate) { + [delegate imageSharingProgress:imgs progress:0]; + } + [imgs downloadImageFrom:url]; + } + return imgs; +} + +- (void)dealloc { + [connection release]; + [data release]; + [delegate release]; + [userInfo release]; + [super dealloc]; +} + + +#pragma mark - + +- (void)cancel { + [connection cancel]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer [%@] interrupted by user", [connection.currentRequest.URL absoluteString]]; + if(delegate) { + [delegate imageSharingAborted:self]; + } +} + + +- (void)downloadImageFrom:(NSURL*)url { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", [url absoluteString]]; + + NSURLRequest* request = [NSURLRequest requestWithURL:url + cachePolicy:NSURLRequestUseProtocolCachePolicy + timeoutInterval:60.0]; + + connection = [[NSURLConnection alloc] initWithRequest:request delegate: self]; +} + + +- (void)uploadImageTo:(NSURL*)url image:(UIImage*)image { + [LinphoneLogger log:LinphoneLoggerLog format:@"downloading [%@]", [url absoluteString]]; + + // setting up the request object now + NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease]; + [request setURL:url]; + [request setHTTPMethod:@"POST"]; + + /* + add some header info now + we always need a boundary when we post a file + also we need to set the content type + + You might want to generate a random boundary.. this is just the same + as my output from wireshark on a valid html post + */ + NSString *boundary = @"---------------------------14737809831466499882746641449"; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; + [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; + + /* + now lets create the body of the post + */ + NSMutableData *body = [NSMutableData data]; + NSString *imageName = [NSString stringWithFormat:@"%i.jpg", [image hash]]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@\"\r\n",imageName] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[NSData dataWithData:UIImageJPEGRepresentation(image, 1.0)]]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [request setHTTPBody:body]; + + connection = [[NSURLConnection alloc] initWithRequest:(NSURLRequest *)request delegate:self]; +} + + +#pragma mark - NSURLConnectionDelegate + +- (void)connection:(NSURLConnection *)aconnection didFailWithError:(NSError *)error { + if(delegate) { + [delegate imageSharingError:self error:error]; + } + [self release]; +} + +- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite { + if(upload && delegate) { + [delegate imageSharingProgress:self progress:(float)totalBytesWritten/(float)totalBytesExpectedToWrite]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)adata { + [data appendData:adata]; + if(!upload && delegate) { + [delegate imageSharingProgress:self progress:(float)data.length/(float)totalBytesExpectedToRead]; + } +} + +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { + NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; + statusCode = httpResponse.statusCode; + [LinphoneLogger log:LinphoneLoggerLog format:@"File transfer status code [%i]",statusCode]; + + if (statusCode == 200 && !upload) { + totalBytesExpectedToRead = [response expectedContentLength]; + } +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)connection { + if(statusCode >= 400) { + NSError *error = [NSError errorWithDomain:@"ImageSharing" code:statusCode userInfo:nil]; + if(delegate) { + [delegate imageSharingError:self error:error]; + } + return; + } + if (upload) { + NSString* imageRemoteUrl = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File can be downloaded from [%@]", imageRemoteUrl]; + if(delegate) { + [delegate imageSharingUploadDone:self url:[NSURL URLWithString:imageRemoteUrl]]; + } + } else { + UIImage* image = [UIImage imageWithData:data]; + [LinphoneLogger log:LinphoneLoggerLog format:@"File downloaded"]; + if(delegate) { + [delegate imageSharingDownloadDone:self image:image]; + } + } + [self release]; +} + +@end diff --git a/Classes/LinphoneAppDelegate.h b/Classes/LinphoneAppDelegate.h index 50cb4bc0a..cad7eba73 100644 --- a/Classes/LinphoneAppDelegate.h +++ b/Classes/LinphoneAppDelegate.h @@ -26,9 +26,11 @@ @end @interface LinphoneAppDelegate : NSObject { - UIWindow *window; + @private + UIWindow *window; CTCallCenter* callCenter; BOOL started; + int savedMaxCall; } @property (assign) BOOL started; diff --git a/Classes/LinphoneAppDelegate.m b/Classes/LinphoneAppDelegate.m index 944254e5f..e6aa9ed53 100644 --- a/Classes/LinphoneAppDelegate.m +++ b/Classes/LinphoneAppDelegate.m @@ -305,12 +305,12 @@ #pragma mark - PushNotification Functions - (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken { - [LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Token %@", deviceToken]; + [LinphoneLogger log:LinphoneLoggerLog format:@"PushNotification: Token %@", deviceToken]; [[LinphoneManager instance] setPushNotificationToken:deviceToken]; } - (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error { - [LinphoneLogger log:LinphoneLoggerDebug format:@"PushNotification: Error %@", error]; + [LinphoneLogger log:LinphoneLoggerError format:@"PushNotification: Error %@", [error localizedDescription]]; [[LinphoneManager instance] setPushNotificationToken:nil]; } diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 32dc60aa6..bffc03b24 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -21,6 +21,8 @@ #import #import #import +#import + #import #import "FastAddressBook.h" @@ -30,6 +32,9 @@ /**/ #include "linphonecore.h" +extern const char *const LINPHONERC_APPLICATION_KEY; + +extern NSString *const kLinphoneCoreUpdate; extern NSString *const kLinphoneDisplayStatusUpdate; extern NSString *const kLinphoneTextReceived; extern NSString *const kLinphoneCallUpdate; @@ -125,14 +130,18 @@ typedef struct _LinphoneManagerSounds { - (void)call:(NSString *)address displayName:(NSString*)displayName transfer:(BOOL)transfer; --(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key; --(NSString*)lpConfigStringForKey:(NSString*) key; - --(void)lpConfigSetInt:(NSInteger) value forKey:(NSString*) key; --(NSInteger)lpConfigIntForKey:(NSString*) key; - --(void)lpConfigSetBool:(BOOL) value forKey:(NSString*) key; --(BOOL)lpConfigBoolForKey:(NSString*) key; +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key; +- (NSString*)lpConfigStringForKey:(NSString*)key; +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString*)section; +- (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString*)section; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key; +- (NSInteger)lpConfigIntForKey:(NSString*)key; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString*)section; +- (NSInteger)lpConfigIntForKey:(NSString*)key forSection:(NSString*)section; +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key; +- (BOOL)lpConfigBoolForKey:(NSString*)key; +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString*)section; +- (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString*)section; /* MODIFICATION: Add NSUSerdefault settings */ - (BOOL)reconfigureLinphone; @@ -148,6 +157,7 @@ typedef struct _LinphoneManagerSounds { @property (readonly) LinphoneManagerSounds sounds; @property (readonly) NSMutableArray *logs; @property (nonatomic, assign) BOOL speakerEnabled; +@property (readonly) ALAssetsLibrary *photoLibrary; @end diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 93bdba620..859a9abd5 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -42,6 +42,9 @@ static void audioRouteChangeListenerCallback ( static LinphoneCore* theLinphoneCore = nil; static LinphoneManager* theLinphoneManager = nil; +const char *const LINPHONERC_APPLICATION_KEY = "app"; + +NSString *const kLinphoneCoreUpdate = @"kLinphoneCoreUpdate"; NSString *const kLinphoneDisplayStatusUpdate = @"LinphoneDisplayStatusUpdate"; NSString *const kLinphoneTextReceived = @"LinphoneTextReceived"; NSString *const kLinphoneCallUpdate = @"LinphoneCallUpdate"; @@ -225,7 +228,7 @@ struct codec_name_pref_table codec_pref_table[]={ [self openDatabase]; /**/ [self copyDefaultSettings]; - lastRemoteNotificationTime=0; + lastRemoteNotificationTime=0; /* MODIFICATION: Add buschjaeger configuration */ configuration = [[BuschJaegerConfiguration alloc] init]; [configuration loadFile:kLinphoneConfigurationPath]; @@ -441,9 +444,9 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo #pragma mark - Text Received Functions -- (void)onTextReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room from:(const LinphoneAddress *)from message:(const char *)message { +- (void)onMessageReceived:(LinphoneCore *)lc room:(LinphoneChatRoom *)room message:(LinphoneChatMessage*)msg { - char *fromStr = linphone_address_as_string_uri_only(from); + char *fromStr = linphone_address_as_string_uri_only(linphone_chat_message_get_from(msg)); if(fromStr == NULL) return; @@ -452,20 +455,23 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo ChatModel *chat = [[ChatModel alloc] init]; [chat setLocalContact:@""]; [chat setRemoteContact:[NSString stringWithUTF8String:fromStr]]; - [chat setMessage:[NSString stringWithUTF8String:message]]; - [chat setDirection:[NSNumber numberWithInt:1]]; + if (linphone_chat_message_get_external_body_url(msg)) { + [chat setMessage:[NSString stringWithUTF8String:linphone_chat_message_get_external_body_url(msg)]]; + } else { + [chat setMessage:[NSString stringWithUTF8String:linphone_chat_message_get_text(msg)]]; + } + [chat setDirection:[NSNumber numberWithInt:1]]; [chat setTime:[NSDate date]]; [chat setRead:[NSNumber numberWithInt:0]]; [chat create]; ms_free(fromStr); - // Post event NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: - [NSValue valueWithPointer:room], @"room", - [NSValue valueWithPointer:from], @"from", - [NSString stringWithUTF8String:message], @"message", - chat, @"chat", + [NSValue valueWithPointer:room], @"room", + [NSValue valueWithPointer:linphone_chat_message_get_from(msg)], @"from", + chat.message, @"message", + chat, @"chat", nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self userInfo:dict]; [chat release]; @@ -474,14 +480,13 @@ static void linphone_iphone_registration_state(LinphoneCore *lc, LinphoneProxyCo // Post event NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSValue valueWithPointer:room], @"room", - [NSValue valueWithPointer:from], @"from", - [NSString stringWithUTF8String:message], @"message", + [NSValue valueWithPointer:msg], @"message", nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneTextReceived object:self userInfo:dict]; } -static void linphone_iphone_text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) { - [(LinphoneManager*)linphone_core_get_user_data(lc) onTextReceived:lc room:room from:from message:message]; +static void linphone_iphone_message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message) { + [(LinphoneManager*)linphone_core_get_user_data(lc) onMessageReceived:lc room:room message:message]; } @@ -537,7 +542,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach [LinphoneManager kickOffNetworkConnection]; } else { Connectivity newConnectivity; - BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]),"app","wifi_only_preference",FALSE); + BOOL isWifiOnly = lp_config_get_int(linphone_core_get_config([LinphoneManager getLc]), LINPHONERC_APPLICATION_KEY, "wifi_only_preference",FALSE); if (!ctx || ctx->testWWan) newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi; else @@ -611,7 +616,8 @@ static LinphoneCoreVTable linphonec_vtable = { .display_message=linphone_iphone_log, .display_warning=linphone_iphone_log, .display_url=NULL, - .text_received=linphone_iphone_text_received, + .text_received=NULL, + .message_received=linphone_iphone_message_received, .dtmf_received=NULL, .transfer_state_changed=linphone_iphone_transfer_state_changed }; @@ -624,13 +630,11 @@ static LinphoneCoreVTable linphonec_vtable = { - (void)startLibLinphone { //get default config from bundle - NSBundle* myBundle = [NSBundle mainBundle]; - NSString* factoryConfig = [myBundle pathForResource:[LinphoneManager runningOnIpad]?@"linphonerc-factory~ipad":@"linphonerc-factory" ofType:nil] ; - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); - NSString *confiFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/.linphonerc"]; - NSString *zrtpSecretsFileName = [[paths objectAtIndex:0] stringByAppendingString:@"/zrtp_secrets"]; - const char* lRootCa = [[myBundle pathForResource:@"rootca"ofType:@"pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - connectivity=none; + NSString* factoryConfig = [LinphoneManager bundleFile:[LinphoneManager runningOnIpad]?@"linphonerc-factory~ipad":@"linphonerc-factory"]; + NSString *confiFileName = [LinphoneManager documentFile:@".linphonerc"]; + NSString *zrtpSecretsFileName = [LinphoneManager documentFile:@"zrtp_secrets"]; + const char* lRootCa = [[LinphoneManager bundleFile:@"rootca.pem"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + connectivity = none; signal(SIGPIPE, SIG_IGN); //log management @@ -656,17 +660,16 @@ static LinphoneCoreVTable linphonec_vtable = { , [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]] , [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]] ,self); - - + fastAddressBook = [[FastAddressBook alloc] init]; linphone_core_set_root_ca(theLinphoneCore, lRootCa); // Set audio assets - const char* lRing = [[myBundle pathForResource:@"ring"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; - linphone_core_set_ring(theLinphoneCore, lRing ); - const char* lRingBack = [[myBundle pathForResource:@"ringback"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lRing = [[LinphoneManager bundleFile:@"ring.wab"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + linphone_core_set_ring(theLinphoneCore, lRing); + const char* lRingBack = [[LinphoneManager bundleFile:@"ringback.wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_ringback(theLinphoneCore, lRingBack); - const char* lPlay = [[myBundle pathForResource:@"hold"ofType:@"wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; + const char* lPlay = [[LinphoneManager bundleFile:@"hold.wav"] cStringUsingEncoding:[NSString defaultCStringEncoding]]; linphone_core_set_play_file(theLinphoneCore, lPlay); linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]); @@ -698,7 +701,7 @@ static LinphoneCoreVTable linphonec_vtable = { [error release]; } - NSString* path = [myBundle pathForResource:@"nowebcamCIF" ofType:@"jpg"]; + NSString* path = [LinphoneManager bundleFile:@"nowebcamCIF.jpg"]; if (path) { const char* imagePath = [path cStringUsingEncoding:[NSString defaultCStringEncoding]]; [LinphoneLogger logc:LinphoneLoggerLog format:"Using '%s' as source image for no webcam", imagePath]; @@ -747,7 +750,11 @@ static LinphoneCoreVTable linphonec_vtable = { && [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { //go directly to bg mode [self resignActive]; - } + } + + // Post event + NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate object:[LinphoneManager instance] userInfo:dict]; } - (void)destroyLibLinphone { @@ -759,6 +766,11 @@ static LinphoneCoreVTable linphonec_vtable = { [LinphoneLogger logc:LinphoneLoggerLog format:"Destroy linphonecore"]; linphone_core_destroy(theLinphoneCore); theLinphoneCore = nil; + + // Post event + NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; + [[NSNotificationCenter defaultCenter] postNotificationName:kLinphoneCoreUpdate object:[LinphoneManager instance] userInfo:dict]; + SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); if (proxyReachability) CFRelease(proxyReachability); @@ -1025,10 +1037,10 @@ static void audioRouteChangeListenerCallback ( */ } -- (void)addPushTokenToProxyConfig: (LinphoneProxyConfig*)proxyCfg{ +- (void)addPushTokenToProxyConfig:(LinphoneProxyConfig*)proxyCfg{ /* MODIFICATION: Disable pushnotification NSData *tokenData = pushNotificationToken; - if(tokenData != nil) { + if(tokenData != nil && [self lpConfigBoolForKey:@"pusnotification_preference"]) { const unsigned char *tokenBuffer = [tokenData bytes]; NSMutableString *tokenString = [NSMutableString stringWithCapacity:[tokenData length]*2]; for(int i = 0; i < [tokenData length]; ++i) { @@ -1376,34 +1388,62 @@ static void audioRouteChangeListenerCallback ( /**/ +#pragma mark - LPConfig Functions - - --(void)lpConfigSetString:(NSString*) value forKey:(NSString*) key { - lp_config_set_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value?[value UTF8String]:NULL); +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key { + [self lpConfigSetString:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } --(NSString*)lpConfigStringForKey:(NSString*) key { - if (!theLinphoneCore) { - [LinphoneLogger log:LinphoneLoggerError format:@"cannot read configuration because linphone core not ready yet"]; - return nil; - }; - const char* value=lp_config_get_string(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String],NULL); - if (value) - return [NSString stringWithCString:value encoding:[NSString defaultCStringEncoding]]; + +- (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString *)section { + if (!key) return; + lp_config_set_string(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], value?[value UTF8String]:NULL); +} + +- (NSString*)lpConfigStringForKey:(NSString*)key { + return [self lpConfigStringForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString *)section { + if (!key) return nil; + const char* value = lp_config_get_string(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], NULL); + if (value) + return [NSString stringWithUTF8String:value]; else return nil; } --(void)lpConfigSetInt:(NSInteger) value forKey:(NSString*) key { - lp_config_set_int(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String], value ); -} --(NSInteger)lpConfigIntForKey:(NSString*) key { - return lp_config_get_int(linphone_core_get_config(theLinphoneCore),"app",[key UTF8String],-1); + +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key { + [self lpConfigSetInt:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } --(void)lpConfigSetBool:(BOOL) value forKey:(NSString*) key { - return [self lpConfigSetInt:(NSInteger)(value==TRUE) forKey:key]; +- (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key forSection:(NSString *)section { + if (!key) return; + lp_config_set_int(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], value ); } --(BOOL)lpConfigBoolForKey:(NSString*) key { - return [self lpConfigIntForKey:key] == 1; + +- (NSInteger)lpConfigIntForKey:(NSString*)key { + return [self lpConfigIntForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } + +- (NSInteger)lpConfigIntForKey:(NSString*)key forSection:(NSString *)section { + if (!key) return -1; + return lp_config_get_int(linphone_core_get_config(theLinphoneCore), [section UTF8String], [key UTF8String], -1); +} + +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key { + [self lpConfigSetBool:value forKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString *)section { + return [self lpConfigSetInt:(NSInteger)(value == TRUE) forKey:key forSection:section]; +} + +- (BOOL)lpConfigBoolForKey:(NSString*)key { + return [self lpConfigBoolForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; +} + +- (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString *)section { + return [self lpConfigIntForKey:key forSection:section] == 1; +} + @end diff --git a/Classes/LinphoneUI/UICamSwitch.m b/Classes/LinphoneUI/UICamSwitch.m index bc4a621c3..8dba965ed 100644 --- a/Classes/LinphoneUI/UICamSwitch.m +++ b/Classes/LinphoneUI/UICamSwitch.m @@ -82,15 +82,14 @@ return; } if (nextCamId != currentCamId) { - [LinphoneLogger logc:LinphoneLoggerLog format:"Switching from [%s] to [%s]",currentCamId,nextCamId]; + [LinphoneLogger logc:LinphoneLoggerLog format:"Switching from [%s] to [%s]", currentCamId, nextCamId]; linphone_core_set_video_device([LinphoneManager getLc], nextCamId); - nextCamId=currentCamId; + nextCamId = currentCamId; currentCamId = linphone_core_get_video_device([LinphoneManager getLc]); - linphone_core_update_call([LinphoneManager getLc] - , linphone_core_get_current_call([LinphoneManager getLc]) - , NULL); - /*linphone_core_set_native_preview_window_id([LinphoneManager getLc], - (unsigned long)preview);*/ + LinphoneCall *call = linphone_core_get_current_call([LinphoneManager getLc]); + if(call != NULL) { + linphone_core_update_call([LinphoneManager getLc], call, NULL); + } } } diff --git a/Classes/LinphoneUI/UILightButton.h b/Classes/LinphoneUI/UILightButton.h index 0280733cd..439a85951 100644 --- a/Classes/LinphoneUI/UILightButton.h +++ b/Classes/LinphoneUI/UILightButton.h @@ -27,7 +27,7 @@ } --(void) send; +- (void)send; @end diff --git a/Classes/Utils/DTFoundation/DTActionSheet.h b/Classes/Utils/DTFoundation/DTActionSheet.h new file mode 100755 index 000000000..2c2a8b23d --- /dev/null +++ b/Classes/Utils/DTFoundation/DTActionSheet.h @@ -0,0 +1,49 @@ +// +// DTActionSheet.h +// DTFoundation +// +// Created by Oliver Drobnik on 08.06.12. +// Copyright (c) 2012 Cocoanetics. All rights reserved. +// + +typedef void (^DTActionSheetBlock)(void); + +/** + Extends UIActionSheet with support for blocks + */ + +@interface DTActionSheet : UIActionSheet + +/** + Initializes the action sheet using the specified title. + */ +- (id)initWithTitle:(NSString *)title; + +/** + Adds a custom button to the action sheet. + @param title The title of the new button. + @param block The block to execute when the button is tapped. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. +*/ +- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block; + +/** + Adds a custom destructive button to the action sheet. + + Since there can only be one destructive button a previously marked destructive button becomes a normal button. + @param title The title of the new button. + @param block The block to execute when the button is tapped. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. + */ +- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block; + +/** + Adds a custom cancel button to the action sheet. + + Since there can only be one cancel button a previously marked cancel button becomes a normal button. + @param title The title of the new button. + @returns The index of the new button. Button indices start at 0 and increase in the order they are added. + */ +- (NSInteger)addCancelButtonWithTitle:(NSString *)title; + +@end diff --git a/Classes/Utils/DTFoundation/DTActionSheet.m b/Classes/Utils/DTFoundation/DTActionSheet.m new file mode 100755 index 000000000..eeb2161bc --- /dev/null +++ b/Classes/Utils/DTFoundation/DTActionSheet.m @@ -0,0 +1,191 @@ +// +// DTActionSheet.m +// DTFoundation +// +// Created by Oliver Drobnik on 08.06.12. +// Copyright (c) 2012 Cocoanetics. All rights reserved. +// + +#import "DTActionSheet.h" + +@interface DTActionSheet () + +@end + +@implementation DTActionSheet +{ + id _externalDelegate; + + NSMutableDictionary *_actionsPerIndex; + + // lookup bitmask what delegate methods are implemented + struct + { + unsigned int delegateSupportsActionSheetCancel:1; + unsigned int delegateSupportsWillPresentActionSheet:1; + unsigned int delegateSupportsDidPresentActionSheet:1; + unsigned int delegateSupportsWillDismissWithButtonIndex:1; + unsigned int delegateSupportsDidDismissWithButtonIndex:1; + } _delegateFlags; +} + +- (id)init +{ + self = [super init]; + if (self) + { + _actionsPerIndex = [[NSMutableDictionary alloc] init]; + self.delegate = self; + } + + return self; +} + +// designated initializer +- (id)initWithTitle:(NSString *)title +{ + self = [self init]; + if (self) + { + self.title = title; + } + + return self; +} + +- (NSInteger)addButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block +{ + NSInteger retIndex = [self addButtonWithTitle:title]; + + if (block) + { + NSNumber *key = [NSNumber numberWithInt:retIndex]; + [_actionsPerIndex setObject:[block copy] forKey:key]; + } + + return retIndex; +} + +- (NSInteger)addDestructiveButtonWithTitle:(NSString *)title block:(DTActionSheetBlock)block +{ + NSInteger retIndex = [self addButtonWithTitle:title block:block]; + [self setDestructiveButtonIndex:retIndex]; + + return retIndex; +} + +- (NSInteger)addCancelButtonWithTitle:(NSString *)title +{ + NSInteger retIndex = [self addButtonWithTitle:title]; + [self setCancelButtonIndex:retIndex]; + + return retIndex; +} + +#pragma UIActionSheetDelegate (forwarded) + +- (void)actionSheetCancel:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsActionSheetCancel) + { + [_externalDelegate actionSheetCancel:actionSheet]; + } +} + +- (void)willPresentActionSheet:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsWillPresentActionSheet) + { + [_externalDelegate willPresentActionSheet:actionSheet]; + } +} + +- (void)didPresentActionSheet:(UIActionSheet *)actionSheet +{ + if (_delegateFlags.delegateSupportsDidPresentActionSheet) + { + [_externalDelegate didPresentActionSheet:actionSheet]; + } +} + +- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex +{ + if (_delegateFlags.delegateSupportsWillDismissWithButtonIndex) + { + [_externalDelegate actionSheet:actionSheet willDismissWithButtonIndex:buttonIndex]; + } +} + + +- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + NSNumber *key = [NSNumber numberWithInt:buttonIndex]; + + DTActionSheetBlock block = [_actionsPerIndex objectForKey:key]; + + if (block) + { + block(); + } + + if (_delegateFlags.delegateSupportsDidDismissWithButtonIndex) + { + [_externalDelegate actionSheet:actionSheet didDismissWithButtonIndex:buttonIndex]; + } +} + + +#pragma mark Properties + +- (id )delegate +{ + return _externalDelegate; +} + +- (void)setDelegate:(id )delegate +{ + if (delegate == self) + { + [super setDelegate:self]; + } + else if (delegate == nil) + { + [super setDelegate:nil]; + _externalDelegate = nil; + } + else + { + _externalDelegate = delegate; + } + + // wipe + memset(&_delegateFlags, 0, sizeof(_delegateFlags)); + + // set flags according to available methods in delegate + if ([_externalDelegate respondsToSelector:@selector(actionSheetCancel:)]) + { + _delegateFlags.delegateSupportsActionSheetCancel = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(willPresentActionSheet:)]) + { + _delegateFlags.delegateSupportsWillPresentActionSheet = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(didPresentActionSheet:)]) + { + _delegateFlags.delegateSupportsDidPresentActionSheet = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(actionSheet:willDismissWithButtonIndex:)]) + { + _delegateFlags.delegateSupportsWillDismissWithButtonIndex = YES; + } + + if ([_externalDelegate respondsToSelector:@selector(actionSheet:didDismissWithButtonIndex:)]) + { + _delegateFlags.delegateSupportsDidDismissWithButtonIndex = YES; + } +} + +@end diff --git a/Classes/Utils/GrowingTextView/HPGrowingTextView.h b/Classes/Utils/GrowingTextView/HPGrowingTextView.h new file mode 100755 index 000000000..56fc70ca5 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPGrowingTextView.h @@ -0,0 +1,104 @@ +// +// HPTextView.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@class HPGrowingTextView; +@class HPTextViewInternal; + +@protocol HPGrowingTextViewDelegate + +@optional +- (BOOL)growingTextViewShouldBeginEditing:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldEndEditing:(HPGrowingTextView *)growingTextView; + +- (void)growingTextViewDidBeginEditing:(HPGrowingTextView *)growingTextView; +- (void)growingTextViewDidEndEditing:(HPGrowingTextView *)growingTextView; + +- (BOOL)growingTextView:(HPGrowingTextView *)growingTextView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text; +- (void)growingTextViewDidChange:(HPGrowingTextView *)growingTextView; + +- (void)growingTextView:(HPGrowingTextView *)growingTextView willChangeHeight:(float)height; +- (void)growingTextView:(HPGrowingTextView *)growingTextView didChangeHeight:(float)height; + +- (void)growingTextViewDidChangeSelection:(HPGrowingTextView *)growingTextView; +- (BOOL)growingTextViewShouldReturn:(HPGrowingTextView *)growingTextView; +@end + +@interface HPGrowingTextView : UIView { + HPTextViewInternal *internalTextView; + + int minHeight; + int maxHeight; + + //class properties + int maxNumberOfLines; + int minNumberOfLines; + + BOOL animateHeightChange; + + //uitextview properties + NSObject *__unsafe_unretained delegate; + UITextAlignment textAlignment; + NSRange selectedRange; + BOOL editable; + UIDataDetectorTypes dataDetectorTypes; + UIReturnKeyType returnKeyType; + + UIEdgeInsets contentInset; +} + +//real class properties +@property int maxNumberOfLines; +@property int minNumberOfLines; +@property BOOL animateHeightChange; +@property (nonatomic, strong) UITextView *internalTextView; + + +//uitextview properties +@property(unsafe_unretained) NSObject *delegate; +@property(nonatomic,strong) NSString *text; +@property(nonatomic,strong) UIFont *font; +@property(nonatomic,strong) UIColor *textColor; +@property(nonatomic) UITextAlignment textAlignment; // default is UITextAlignmentLeft +@property(nonatomic) NSRange selectedRange; // only ranges of length 0 are supported +@property(nonatomic,getter=isEditable) BOOL editable; +@property(nonatomic) UIDataDetectorTypes dataDetectorTypes __OSX_AVAILABLE_STARTING(__MAC_NA, __IPHONE_3_0); +@property (nonatomic) UIReturnKeyType returnKeyType; +@property (assign) UIEdgeInsets contentInset; +@property(nonatomic) BOOL enablesReturnKeyAutomatically; + +//uitextview methods +//need others? use .internalTextView +- (BOOL)becomeFirstResponder; +- (BOOL)resignFirstResponder; +- (BOOL)isFirstResponder; + +- (BOOL)hasText; +- (void)scrollRangeToVisible:(NSRange)range; + +@end diff --git a/Classes/Utils/GrowingTextView/HPGrowingTextView.m b/Classes/Utils/GrowingTextView/HPGrowingTextView.m new file mode 100755 index 000000000..5094a59a6 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPGrowingTextView.m @@ -0,0 +1,539 @@ +// +// HPTextView.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPGrowingTextView.h" +#import "HPTextViewInternal.h" + +@interface HPGrowingTextView(private) +-(void)commonInitialiser; +-(void)resizeTextView:(NSInteger)newSizeH; +-(void)growDidStop; +@end + +@implementation HPGrowingTextView +@synthesize internalTextView; +@synthesize delegate; + +@synthesize font; +@synthesize textColor; +@synthesize textAlignment; +@synthesize selectedRange; +@synthesize editable; +@synthesize dataDetectorTypes; +@synthesize animateHeightChange; +@synthesize returnKeyType; + +// having initwithcoder allows us to use HPGrowingTextView in a Nib. -- aob, 9/2011 +- (id)initWithCoder:(NSCoder *)aDecoder +{ + if ((self = [super initWithCoder:aDecoder])) { + [self commonInitialiser]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self commonInitialiser]; + } + return self; +} + +-(void)commonInitialiser +{ + // Initialization code + CGRect r = self.frame; + r.origin.y = 0; + r.origin.x = 0; + internalTextView = [[HPTextViewInternal alloc] initWithFrame:r]; + internalTextView.delegate = self; + internalTextView.scrollEnabled = NO; + internalTextView.font = [UIFont fontWithName:@"Helvetica" size:13]; + internalTextView.contentInset = UIEdgeInsetsZero; + internalTextView.showsHorizontalScrollIndicator = NO; + internalTextView.text = @"-"; + [self addSubview:internalTextView]; + + minHeight = internalTextView.frame.size.height; + minNumberOfLines = 1; + + animateHeightChange = YES; + + internalTextView.text = @""; + + [self setMaxNumberOfLines:3]; +} + +-(CGSize)sizeThatFits:(CGSize)size +{ + if (self.text.length == 0) { + size.height = minHeight; + } + return size; +} + +-(void)layoutSubviews +{ + [super layoutSubviews]; + + CGRect r = self.bounds; + r.origin.y = 0; + r.origin.x = contentInset.left; + r.size.width -= contentInset.left + contentInset.right; + + internalTextView.frame = r; +} + +-(void)setContentInset:(UIEdgeInsets)inset +{ + contentInset = inset; + + CGRect r = self.frame; + r.origin.y = inset.top - inset.bottom; + r.origin.x = inset.left; + r.size.width -= inset.left + inset.right; + + internalTextView.frame = r; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIEdgeInsets)contentInset +{ + return contentInset; +} + +-(void)setMaxNumberOfLines:(int)n +{ + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < n; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + maxHeight = internalTextView.contentSize.height; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + maxNumberOfLines = n; +} + +-(int)maxNumberOfLines +{ + return maxNumberOfLines; +} + +-(void)setMinNumberOfLines:(int)m +{ + // Use internalTextView for height calculations, thanks to Gwynne + NSString *saveText = internalTextView.text, *newText = @"-"; + + internalTextView.delegate = nil; + internalTextView.hidden = YES; + + for (int i = 1; i < m; ++i) + newText = [newText stringByAppendingString:@"\n|W|"]; + + internalTextView.text = newText; + + minHeight = internalTextView.contentSize.height; + + internalTextView.text = saveText; + internalTextView.hidden = NO; + internalTextView.delegate = self; + + [self sizeToFit]; + + minNumberOfLines = m; +} + +-(int)minNumberOfLines +{ + return minNumberOfLines; +} + + +- (void)textViewDidChange:(UITextView *)textView +{ + //size of content, so we can set the frame of self + NSInteger newSizeH = internalTextView.contentSize.height; + if(newSizeH < minHeight || !internalTextView.hasText) newSizeH = minHeight; //not smalles than minHeight + if (internalTextView.frame.size.height > maxHeight) newSizeH = maxHeight; // not taller than maxHeight + + if (internalTextView.frame.size.height != newSizeH) + { + // [fixed] Pasting too much text into the view failed to fire the height change, + // thanks to Gwynne + + if (newSizeH > maxHeight && internalTextView.frame.size.height <= maxHeight) + { + newSizeH = maxHeight; + } + + if (newSizeH <= maxHeight) + { + if(animateHeightChange) { + + if ([UIView resolveClassMethod:@selector(animateWithDuration:animations:)]) { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 + [UIView animateWithDuration:0.1f + delay:0 + options:(UIViewAnimationOptionAllowUserInteraction| + UIViewAnimationOptionBeginFromCurrentState) + animations:^(void) { + [self resizeTextView:newSizeH]; + } + completion:^(BOOL finished) { + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + }]; +#endif + } else { + [UIView beginAnimations:@"" context:nil]; + [UIView setAnimationDuration:0.1f]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(growDidStop)]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [self resizeTextView:newSizeH]; + [UIView commitAnimations]; + } + } else { + [self resizeTextView:newSizeH]; + // [fixed] The growingTextView:didChangeHeight: delegate method was not called at all when not animating height changes. + // thanks to Gwynne + + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:newSizeH]; + } + } + } + + + // if our new height is greater than the maxHeight + // sets not set the height or move things + // around and enable scrolling + if (newSizeH >= maxHeight) + { + if(!internalTextView.scrollEnabled){ + internalTextView.scrollEnabled = YES; + [internalTextView flashScrollIndicators]; + } + + } else { + internalTextView.scrollEnabled = NO; + } + + } + + + if ([delegate respondsToSelector:@selector(growingTextViewDidChange:)]) { + [delegate growingTextViewDidChange:self]; + } + +} + +-(void)resizeTextView:(NSInteger)newSizeH +{ + if ([delegate respondsToSelector:@selector(growingTextView:willChangeHeight:)]) { + [delegate growingTextView:self willChangeHeight:newSizeH]; + } + + CGRect internalTextViewFrame = self.frame; + internalTextViewFrame.size.height = newSizeH; // + padding + self.frame = internalTextViewFrame; + + internalTextViewFrame.origin.y = contentInset.top - contentInset.bottom; + internalTextViewFrame.origin.x = contentInset.left; + internalTextViewFrame.size.width = internalTextView.contentSize.width; + + internalTextView.frame = internalTextViewFrame; +} + +-(void)growDidStop +{ + if ([delegate respondsToSelector:@selector(growingTextView:didChangeHeight:)]) { + [delegate growingTextView:self didChangeHeight:self.frame.size.height]; + } + +} + +-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event +{ + [internalTextView becomeFirstResponder]; +} + +- (BOOL)becomeFirstResponder +{ + [super becomeFirstResponder]; + return [self.internalTextView becomeFirstResponder]; +} + +-(BOOL)resignFirstResponder +{ + [super resignFirstResponder]; + return [internalTextView resignFirstResponder]; +} + +-(BOOL)isFirstResponder +{ + return [self.internalTextView isFirstResponder]; +} + + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark UITextView properties +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setText:(NSString *)newText +{ + internalTextView.text = newText; + + // include this line to analyze the height of the textview. + // fix from Ankit Thakur + [self performSelector:@selector(textViewDidChange:) withObject:internalTextView]; +} + +-(NSString*) text +{ + return internalTextView.text; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setFont:(UIFont *)afont +{ + internalTextView.font= afont; + + [self setMaxNumberOfLines:maxNumberOfLines]; + [self setMinNumberOfLines:minNumberOfLines]; +} + +-(UIFont *)font +{ + return internalTextView.font; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextColor:(UIColor *)color +{ + internalTextView.textColor = color; +} + +-(UIColor*)textColor{ + return internalTextView.textColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setBackgroundColor:(UIColor *)backgroundColor +{ + [super setBackgroundColor:backgroundColor]; + internalTextView.backgroundColor = backgroundColor; +} + +-(UIColor*)backgroundColor +{ + return internalTextView.backgroundColor; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setTextAlignment:(UITextAlignment)aligment +{ + internalTextView.textAlignment = aligment; +} + +-(UITextAlignment)textAlignment +{ + return internalTextView.textAlignment; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setSelectedRange:(NSRange)range +{ + internalTextView.selectedRange = range; +} + +-(NSRange)selectedRange +{ + return internalTextView.selectedRange; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setEditable:(BOOL)beditable +{ + internalTextView.editable = beditable; +} + +-(BOOL)isEditable +{ + return internalTextView.editable; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setReturnKeyType:(UIReturnKeyType)keyType +{ + internalTextView.returnKeyType = keyType; +} + +-(UIReturnKeyType)returnKeyType +{ + return internalTextView.returnKeyType; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (void)setEnablesReturnKeyAutomatically:(BOOL)enablesReturnKeyAutomatically +{ + internalTextView.enablesReturnKeyAutomatically = enablesReturnKeyAutomatically; +} + +- (BOOL)enablesReturnKeyAutomatically +{ + return internalTextView.enablesReturnKeyAutomatically; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +-(void)setDataDetectorTypes:(UIDataDetectorTypes)datadetector +{ + internalTextView.dataDetectorTypes = datadetector; +} + +-(UIDataDetectorTypes)dataDetectorTypes +{ + return internalTextView.dataDetectorTypes; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +- (BOOL)hasText{ + return [internalTextView hasText]; +} + +- (void)scrollRangeToVisible:(NSRange)range +{ + [internalTextView scrollRangeToVisible:range]; +} + +///////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma mark - +#pragma mark UITextViewDelegate + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldBeginEditing:)]) { + return [delegate growingTextViewShouldBeginEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textViewShouldEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewShouldEndEditing:)]) { + return [delegate growingTextViewShouldEndEditing:self]; + + } else { + return YES; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidBeginEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidBeginEditing:)]) { + [delegate growingTextViewDidBeginEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidEndEditing:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidEndEditing:)]) { + [delegate growingTextViewDidEndEditing:self]; + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range + replacementText:(NSString *)atext { + + //weird 1 pixel bug when clicking backspace when textView is empty + if(![textView hasText] && [atext isEqualToString:@""]) return NO; + + //Added by bretdabaker: sometimes we want to handle this ourselves + if ([delegate respondsToSelector:@selector(growingTextView:shouldChangeTextInRange:replacementText:)]) + return [delegate growingTextView:self shouldChangeTextInRange:range replacementText:atext]; + + if ([atext isEqualToString:@"\n"]) { + if ([delegate respondsToSelector:@selector(growingTextViewShouldReturn:)]) { + if (![delegate performSelector:@selector(growingTextViewShouldReturn:) withObject:self]) { + return YES; + } else { + [textView resignFirstResponder]; + return NO; + } + } + } + + return YES; + + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +- (void)textViewDidChangeSelection:(UITextView *)textView { + if ([delegate respondsToSelector:@selector(growingTextViewDidChangeSelection:)]) { + [delegate growingTextViewDidChangeSelection:self]; + } +} + + + +@end diff --git a/Classes/Utils/GrowingTextView/HPTextViewInternal.h b/Classes/Utils/GrowingTextView/HPTextViewInternal.h new file mode 100755 index 000000000..c44ac63dc --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPTextViewInternal.h @@ -0,0 +1,34 @@ +// +// HPTextViewInternal.h +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + + +@interface HPTextViewInternal : UITextView { +} + +@end diff --git a/Classes/Utils/GrowingTextView/HPTextViewInternal.m b/Classes/Utils/GrowingTextView/HPTextViewInternal.m new file mode 100755 index 000000000..060081b22 --- /dev/null +++ b/Classes/Utils/GrowingTextView/HPTextViewInternal.m @@ -0,0 +1,95 @@ +// +// HPTextViewInternal.m +// +// Created by Hans Pinckaers on 29-06-10. +// +// MIT License +// +// Copyright (c) 2011 Hans Pinckaers +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "HPTextViewInternal.h" + + +@implementation HPTextViewInternal + +-(void)setText:(NSString *)text +{ + BOOL originalValue = self.scrollEnabled; + //If one of GrowingTextView's superviews is a scrollView, and self.scrollEnabled == NO, + //setting the text programatically will cause UIKit to search upwards until it finds a scrollView with scrollEnabled==yes + //then scroll it erratically. Setting scrollEnabled temporarily to YES prevents this. + [self setScrollEnabled:YES]; + [super setText:text]; + [self setScrollEnabled:originalValue]; +} + +-(void)setContentOffset:(CGPoint)s +{ + if(self.tracking || self.decelerating){ + //initiated by user... + + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + + } else { + + float bottomOffset = (self.contentSize.height - self.frame.size.height + self.contentInset.bottom); + if(s.y < bottomOffset && self.scrollEnabled){ + UIEdgeInsets insets = self.contentInset; + insets.bottom = 8; + insets.top = 0; + self.contentInset = insets; + } + } + + [super setContentOffset:s]; +} + +-(void)setContentInset:(UIEdgeInsets)s +{ + UIEdgeInsets insets = s; + + if(s.bottom>8) insets.bottom = 0; + insets.top = 0; + + [super setContentInset:insets]; +} + +-(void)setContentSize:(CGSize)contentSize +{ + // is this an iOS5 bug? Need testing! + if(self.contentSize.height > contentSize.height) + { + UIEdgeInsets insets = self.contentInset; + insets.bottom = 0; + insets.top = 0; + self.contentInset = insets; + } + + [super setContentSize:contentSize]; +} + + + + +@end diff --git a/Classes/en.lproj/ImageViewController.xib b/Classes/en.lproj/ImageViewController.xib new file mode 100644 index 000000000..6db298265 --- /dev/null +++ b/Classes/en.lproj/ImageViewController.xib @@ -0,0 +1,304 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + + + _NS:9 + + 3 + MCAwAA + + 1 + NO + IBCocoaTouchFramework + + + + 290 + + + + 290 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {160, 44} + + + + _NS:9 + NO + + Back + + IBCocoaTouchFramework + 0 + 0 + NO + NO + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + image_back_over.png + + + NSImage + image_back_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {320, 44} + + + + _NS:9 + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + imageView + + + + 9 + + + + backButton + + + + 8 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + imageView + + + 11 + + + + + + + toolbar + + + 7 + + + backButton + + + 6 + + + background + + + + + ImageViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 88} + {320, 88} + {5, 117} + + 1498 + + diff --git a/Classes/fr.lproj/ImageViewController.xib b/Classes/fr.lproj/ImageViewController.xib new file mode 100644 index 000000000..ad5e29808 --- /dev/null +++ b/Classes/fr.lproj/ImageViewController.xib @@ -0,0 +1,297 @@ + + + + 1296 + 11E53 + 1938 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 933 + + + IBUIButton + IBUIImageView + IBUIView + IBProxyObject + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + _NS:9 + + 3 + MCAwAA + + 1 + NO + IBCocoaTouchFramework + + + + 290 + + + + 290 + {320, 44} + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {160, 44} + + + _NS:9 + NO + + Retour + + IBCocoaTouchFramework + 0 + 0 + NO + NO + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + image_back_over.png + + + NSImage + image_back_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {320, 44} + + + _NS:9 + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + imageView + + + + 9 + + + + backButton + + + + 8 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + imageView + + + 11 + + + + + + + toolbar + + + 7 + + + backButton + + + 6 + + + background + + + + + ImageViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 88} + {320, 88} + {5, 117} + + 933 + + diff --git a/README b/README index 096cfdadb..7b824cf55 100644 --- a/README +++ b/README @@ -30,6 +30,8 @@ Link host's strings to simulator SDK For newer XCode: $ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings +ImageMagick & Optipng + sudo port install ImageMagick optipng BUILDING THE SDK **************** @@ -50,6 +52,8 @@ BUILDING THE SDK $ cd submodules/build $ make all enable_gpl_third_parties=no +xcode 4.5i/ios6 beta do: + $ make -f Makefile.ios6-beta * ZRTP support You can enable ZRTP support in GPL mode only, by adding "enable_zrtp=yes" to the make command, for example: @@ -74,6 +78,12 @@ The liblinphone-sdk is compiled with third parties code that are subject to pate Linphone controls the embedding of these codecs thanks to the preprocessor macros HAVE_SILK, HAVE_AMR, HAVE_G729 HAVE_X264 positioned in xcode project. Before embeding these 4 codecs in the final application, make sure to have the right to do so. +TRANSLATER THE APPLICATION +************************** + +You have to download the application Localization Suite(http://www.loc-suite.org/) +Each modification in a xib have to be scanned and synchronized + LIMITATIONS, KNOWN BUGS *********************** diff --git a/Resources/background_alt.png b/Resources/background_alt.png new file mode 100644 index 000000000..3e178844a Binary files /dev/null and b/Resources/background_alt.png differ diff --git a/Resources/chat_background.9.png b/Resources/chat_background.9.png new file mode 100644 index 000000000..9119454eb Binary files /dev/null and b/Resources/chat_background.9.png differ diff --git a/Resources/chat_background.9@2x.png b/Resources/chat_background.9@2x.png new file mode 100644 index 000000000..2094325bf Binary files /dev/null and b/Resources/chat_background.9@2x.png differ diff --git a/Resources/chat_background.png b/Resources/chat_background.png new file mode 100644 index 000000000..c438371b0 Binary files /dev/null and b/Resources/chat_background.png differ diff --git a/Resources/image_back_default.png b/Resources/image_back_default.png new file mode 100644 index 000000000..60412bd95 Binary files /dev/null and b/Resources/image_back_default.png differ diff --git a/Resources/image_back_over.png b/Resources/image_back_over.png new file mode 100644 index 000000000..bbc3f4ee3 Binary files /dev/null and b/Resources/image_back_over.png differ diff --git a/Resources/linphonerc b/Resources/linphonerc index 5057f2f02..b119f76f0 100644 --- a/Resources/linphonerc +++ b/Resources/linphonerc @@ -17,8 +17,15 @@ show_local=0 enabled=1 size=qvga display_filter_auto_rotate=1 +automatically_initiate=0 +automatically_accept=0 +[net] +firewall_policy=0 +[app] +rotation_preference=auto +animations_preference=1 [default_values] reg_expires=600 \ No newline at end of file diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 19f387254..5eb3ac8fa 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -1,8 +1,10 @@ [net] download_bw=380 upload_bw=380 -firewall_policy=0 mtu=1300 +activate_edge_workarounds=1 +edge_ping_time=200 +edge_bw=10 [sip] guess_hostname=1 @@ -32,4 +34,16 @@ dtmf_player_amp=0.007 history_max_size=30 max_calls=1 +[wizard] +service_url=https://www.linphone.org/wizard.php +domain=sip.linphone.org +proxy=sip.linphone.org:5223 +password_length=6 +username_length=4 +expires=600 +push_notification=1 +transport=tls +sharing_server=https://www.linphone.org:444/upload.php +ice=1 +stun=stun.linphone.org diff --git a/Resources/linphonerc-factory~ipad b/Resources/linphonerc-factory~ipad index e7171b115..841ae7dd2 100644 --- a/Resources/linphonerc-factory~ipad +++ b/Resources/linphonerc-factory~ipad @@ -41,3 +41,4 @@ size=vga recv_buf_size=65535 display_filter_auto_rotate=1 + diff --git a/Resources/linphonerc~ipad b/Resources/linphonerc~ipad index 2b37b20f2..f31880409 100644 --- a/Resources/linphonerc~ipad +++ b/Resources/linphonerc~ipad @@ -4,7 +4,28 @@ sip_tcp_random_port=1 sip_tls_random_port=1 contact="Linphone iPhone" keepalive_period=30000 +default_proxy=0 [rtp] audio_rtp_port=7076 -video_rtp_port=9078 \ No newline at end of file +video_rtp_port=9078 + +[video] +display=1 +capture=1 +show_local=1 +enabled=1 +size=vga +display_filter_auto_rotate=1 +automatically_initiate=0 +automatically_accept=0 + +[net] +firewall_policy=0 + +[app] +rotation_preference=auto +animations_preference=1 + +[default_values] +reg_expires=600 \ No newline at end of file diff --git a/Settings.bundle/Root.plist b/Settings.bundle/Root.plist index d585bdd63..79ca6462e 100644 --- a/Settings.bundle/Root.plist +++ b/Settings.bundle/Root.plist @@ -10,6 +10,14 @@ Type PSGroupSpecifier + + Key + wizard_button + Title + Wizard + Type + IASKButtonSpecifier + AutocapitalizationType None @@ -186,6 +194,14 @@ Type PSTitleValueSpecifier + + Key + battery_alert_button + Title + Battery alert + Type + IASKButtonSpecifier + StringsTable Root diff --git a/Settings/InAppSettings.bundle/en.lproj/Network.strings b/Settings/InAppSettings.bundle/en.lproj/Network.strings new file mode 100644 index 000000000..299b28fbd --- /dev/null +++ b/Settings/InAppSettings.bundle/en.lproj/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Wifi only"; + +/* Stun Server */ +"Stun Server" = "Stun Server"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Random Port"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Audio Port"; + +/* Video Port */ +"Video Port" = "Video Port"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Media Encryption"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* UDP */ +"UDP" = "UDP"; + +/* TCP */ +"TCP" = "TCP"; + +/* TLS */ +"TLS" = "TLS"; + +/* None */ +"None" = "None"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/Settings/InAppSettings.bundle/fr.lproj/Network.strings b/Settings/InAppSettings.bundle/fr.lproj/Network.strings new file mode 100644 index 000000000..e8b26e761 --- /dev/null +++ b/Settings/InAppSettings.bundle/fr.lproj/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Uniquement Wifi"; + +/* Stun Server */ +"Stun Server" = "Serveur Stun"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Port Aléatoire"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Port Audio"; + +/* Video Port */ +"Video Port" = "Port Vidéo"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Chiffrement"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* UDP */ +"UDP" = "UDP"; + +/* TCP */ +"TCP" = "TCP"; + +/* TLS */ +"TLS" = "TLS"; + +/* None */ +"None" = "Aucun"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib b/linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib new file mode 100644 index 000000000..6db298265 --- /dev/null +++ b/linphone.ldb/Resources/Classes/ImageViewController/6/ImageViewController.xib @@ -0,0 +1,304 @@ + + + + 1296 + 11E53 + 2549 + 1138.47 + 569.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 1498 + + + IBProxyObject + IBUIButton + IBUIImageView + IBUIView + + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + PluginDependencyRecalculationVersion + + + + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + + + + 274 + {{0, 44}, {320, 416}} + + + + _NS:9 + + 3 + MCAwAA + + 1 + NO + IBCocoaTouchFramework + + + + 290 + + + + 290 + {320, 44} + + + + _NS:9 + NO + IBCocoaTouchFramework + + NSImage + toolsbar_background.png + + + + + 292 + {160, 44} + + + + _NS:9 + NO + + Back + + IBCocoaTouchFramework + 0 + 0 + NO + NO + + 3 + MQA + + + 1 + MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA + + + 3 + MC41AA + + + NSImage + image_back_over.png + + + NSImage + image_back_default.png + + + 2 + 15 + + + Helvetica-Bold + 15 + 16 + + + + {320, 44} + + + + _NS:9 + + IBCocoaTouchFramework + + + {{0, 20}, {320, 460}} + + + + + + IBCocoaTouchFramework + + + + + + + view + + + + 3 + + + + imageView + + + + 9 + + + + backButton + + + + 8 + + + + onBackClick: + + + 7 + + 10 + + + + + + 0 + + + + + + 1 + + + + + + + + + -1 + + + File's Owner + + + -2 + + + + + 4 + + + imageView + + + 11 + + + + + + + toolbar + + + 7 + + + backButton + + + 6 + + + background + + + + + ImageViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + + + + 11 + + + + + ImageViewController + UIViewController + + onBackClick: + id + + + onBackClick: + + onBackClick: + id + + + + UIButton + UIImageView + + + + backButton + UIButton + + + imageView + UIImageView + + + + IBProjectSource + ./Classes/ImageViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + YES + 3 + + {320, 88} + {320, 88} + {5, 117} + + 1498 + + diff --git a/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings new file mode 100644 index 000000000..299b28fbd --- /dev/null +++ b/linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings @@ -0,0 +1,51 @@ +/* Wifi only */ +"Wifi only" = "Wifi only"; + +/* Stun Server */ +"Stun Server" = "Stun Server"; + +/* ICE */ +"ICE" = "ICE"; + +/* Random Port */ +"Random Port" = "Random Port"; + +/* Port */ +"Port" = "Port"; + +/* Audio Port */ +"Audio Port" = "Audio Port"; + +/* Video Port */ +"Video Port" = "Video Port"; + +/* Transport */ +"Transport" = "Transport"; + +/* Media Encryption */ +"Media Encryption" = "Media Encryption"; + +/* Push Notifications */ +"Push Notification" = "Push Notification"; + +/* Transport */ +"Transport" = "Transport"; + +/* UDP */ +"UDP" = "UDP"; + +/* TCP */ +"TCP" = "TCP"; + +/* TLS */ +"TLS" = "TLS"; + +/* None */ +"None" = "None"; + +/* SRTP */ +"SRTP" = "SRTP"; + +/* ZRTP */ +"ZRTP" = "ZRTP"; + diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index ede339d5a..349c26aa8 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -106,6 +106,8 @@ 344ABDE81484E723007420B6 /* libzrtpcpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDE71484E723007420B6 /* libzrtpcpp.a */; }; 344ABDF114850AE9007420B6 /* libc++.1.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDEF14850AE9007420B6 /* libc++.1.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 344ABDF214850AE9007420B6 /* libstdc++.6.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; + 570B130115FE44AF00DE62B6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 570B130015FE44AF00DE62B6 /* libmediastreamer_voip.a */; }; + 570B130315FE44ED00DE62B6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 570B130215FE44ED00DE62B6 /* libmediastreamer_base.a */; }; 57F005C415EE2CCF00914747 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C315EE2CCF00914747 /* linphonerc */; }; 57F005C515EE2CCF00914747 /* linphonerc in Resources */ = {isa = PBXBuildFile; fileRef = 57F005C315EE2CCF00914747 /* linphonerc */; }; 7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; }; @@ -255,6 +257,12 @@ D37CD3A215E2452C0028869A /* BuschJaegerStationTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D37CD3A015E2452B0028869A /* BuschJaegerStationTableViewController.m */; }; D37DC7181594AF3400B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; D37DC7191594AF3F00B2A5EB /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D37DC7171594AF3400B2A5EB /* MessageUI.framework */; }; + D37EE10916032DA4003608A6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; + D37EE10A16032DA4003608A6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; + D37EE10B16032DC2003608A6 /* libmediastreamer_base.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EE916006F0700B92522 /* libmediastreamer_base.a */; }; + D37EE10C16032DC2003608A6 /* libmediastreamer_voip.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */; }; + D37EE162160377D7003608A6 /* DTActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D37EE161160377D7003608A6 /* DTActionSheet.m */; }; + D37EE163160377D7003608A6 /* DTActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = D37EE161160377D7003608A6 /* DTActionSheet.m */; }; D380800515C28A7A005BE9BC /* UILinphone.m in Sources */ = {isa = PBXBuildFile; fileRef = D380800415C28A7A005BE9BC /* UILinphone.m */; }; D380800615C28A7A005BE9BC /* UILinphone.m in Sources */ = {isa = PBXBuildFile; fileRef = D380800415C28A7A005BE9BC /* UILinphone.m */; }; D380801315C299D0005BE9BC /* ColorSpaceUtilites.m in Sources */ = {isa = PBXBuildFile; fileRef = D380801215C299D0005BE9BC /* ColorSpaceUtilites.m */; }; @@ -570,6 +578,8 @@ 344ABDE71484E723007420B6 /* libzrtpcpp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzrtpcpp.a; path = "liblinphone-sdk/apple-darwin/lib/libzrtpcpp.a"; sourceTree = ""; }; 344ABDEF14850AE9007420B6 /* libc++.1.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libc++.1.dylib"; path = "usr/lib/libc++.1.dylib"; sourceTree = SDKROOT; }; 344ABDF014850AE9007420B6 /* libstdc++.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libstdc++.6.dylib"; path = "usr/lib/libstdc++.6.dylib"; sourceTree = SDKROOT; }; + 570B130015FE44AF00DE62B6 /* libmediastreamer_voip.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_voip.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_voip.a"; sourceTree = ""; }; + 570B130215FE44ED00DE62B6 /* libmediastreamer_base.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmediastreamer_base.a; path = "liblinphone-sdk/apple-darwin/lib/libmediastreamer_base.a"; sourceTree = ""; }; 57F005C315EE2CCF00914747 /* linphonerc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = linphonerc; path = Resources/linphonerc; sourceTree = ""; }; 7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = ""; }; 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; @@ -687,6 +697,8 @@ D37CD39F15E245290028869A /* BuschJaegerStationTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuschJaegerStationTableViewController.h; sourceTree = ""; }; D37CD3A015E2452B0028869A /* BuschJaegerStationTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuschJaegerStationTableViewController.m; sourceTree = ""; }; D37DC7171594AF3400B2A5EB /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + D37EE160160377D7003608A6 /* DTActionSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTActionSheet.h; sourceTree = ""; }; + D37EE161160377D7003608A6 /* DTActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTActionSheet.m; sourceTree = ""; }; D380800415C28A7A005BE9BC /* UILinphone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILinphone.m; sourceTree = ""; }; D380801115C29984005BE9BC /* ColorSpaceUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorSpaceUtilities.h; path = Utils/ColorSpaceUtilities.h; sourceTree = ""; }; D380801215C299D0005BE9BC /* ColorSpaceUtilites.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ColorSpaceUtilites.m; path = Utils/ColorSpaceUtilites.m; sourceTree = ""; }; @@ -1207,8 +1219,6 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( - D33BEE2515FF7450004ED2AF /* libmediastreamer_base.a */, - D33BEE2615FF7450004ED2AF /* libmediastreamer_voip.a */, 2258633C11410BAC00C5A737 /* README */, 22276E8013C73D3100210156 /* libavcodec.a */, 22276E8113C73D3100210156 /* libavutil.a */, @@ -1218,6 +1228,8 @@ 220FAD2910765B400068D98F /* libgsm.a */, 223148E31178A08200637D6A /* libilbc.a */, 2211DB911475562600DEE054 /* liblinphone.a */, + 22405EE916006F0700B92522 /* libmediastreamer_base.a */, + 22405EEA16006F0700B92522 /* libmediastreamer_voip.a */, 226F2ED51344B0EF00F6EF27 /* libmsamr.a */, 226CDADE14E2D0B800513B67 /* libmsbcg729.a */, 223148E51178A09900637D6A /* libmsilbc.a */, @@ -1337,6 +1349,7 @@ children = ( D380801215C299D0005BE9BC /* ColorSpaceUtilites.m */, D380801115C29984005BE9BC /* ColorSpaceUtilities.h */, + D37EE15F160377D7003608A6 /* DTFoundation */, D32B9DFA15A2F131000B6DEC /* FastAddressBook.h */, D32B9DFB15A2F131000B6DEC /* FastAddressBook.m */, D326483615887D5200930C67 /* OrderedDictionary.h */, @@ -1378,6 +1391,16 @@ path = Utils/ZBarSDK; sourceTree = ""; }; + D37EE15F160377D7003608A6 /* DTFoundation */ = { + isa = PBXGroup; + children = ( + D37EE160160377D7003608A6 /* DTActionSheet.h */, + D37EE161160377D7003608A6 /* DTActionSheet.m */, + ); + name = DTFoundation; + path = Utils/DTFoundation; + sourceTree = ""; + }; D37CD35615E22B0C0028869A /* Headers */ = { isa = PBXGroup; children = ( @@ -1812,6 +1835,7 @@ HAVE_SILK, DEBUG, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -1880,6 +1904,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -2119,6 +2144,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, @@ -2188,6 +2214,7 @@ HAVE_X264, HAVE_SILK, ); + GCC_TREAT_WARNINGS_AS_ERRORS = YES; HEADER_SEARCH_PATHS = ( submodules/linphone/coreapi, submodules/linphone/mediastreamer2/include, diff --git a/submodules/build/Makefile b/submodules/build/Makefile index 72b7b1d5e..276688bb4 100644 --- a/submodules/build/Makefile +++ b/submodules/build/Makefile @@ -54,28 +54,28 @@ endif LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp) build: - make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) all \ + make -f builder-iphone-os.mk host=armv6-apple-darwin $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-os.mk host=armv7-apple-darwin $(LINPHONE_OPTIONS) all \ && make -f builder-iphone-os.mk delivery-sdk ipa: build make -f builder-iphone-simulator.mk ipa \ - && make -f builder-iphone-os.mk ipa \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin ipa \ && make -f builder-iphone-os.mk host=armv7-apple-darwin ipa clean: make -f builder-iphone-simulator.mk clean \ - && make -f builder-iphone-os.mk clean \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin clean \ && make -f builder-iphone-os.mk host=armv7-apple-darwin clean clean-makefile: make -f builder-iphone-simulator.mk clean-makefile \ - && make -f builder-iphone-os.mk clean-makefile \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin clean-makefile \ && make -f builder-iphone-os.mk host=armv7-apple-darwin clean-makefile veryclean: make -f builder-iphone-simulator.mk veryclean \ - && make -f builder-iphone-os.mk veryclean \ + && make -f builder-iphone-os.mk host=armv6-apple-darwin veryclean \ && make -f builder-iphone-os.mk host=armv7-apple-darwin veryclean diff --git a/submodules/build/Makefile.ios6-beta b/submodules/build/Makefile.ios6-beta new file mode 100644 index 000000000..bb1fd7a6c --- /dev/null +++ b/submodules/build/Makefile.ios6-beta @@ -0,0 +1,81 @@ +############################################################################ +# Makefile +# Copyright (C) 2009 Belledonne Communications,Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ +enable_gpl_third_parties=yes +enable_zrtp=no + +.NOTPARALLEL all: check_options build warning +ifeq ($(enable_gpl_third_parties)$(enable_zrtp),noyes) +check_options: + @echo "ZRTP is not available in non-gpl build." + @exit -1 +else +check_options: + +endif + +ifeq ($(enable_gpl_third_parties),yes) +warning: + @echo + @echo "*****************************************************************" + @echo "*****************************************************************" + @echo "*****CAUTION, this liblinphone SDK is built using GPL code ******" + @echo "*****To disable gpl code, use make enable_gpl_third_parties=no***" + @echo "*****************************************************************" + @echo "*****************************************************************" +else +warning: + @echo + @echo "*****************************************************************" + @echo "*****************************************************************" + @echo "*****linphone SDK without GPL code ******" + @echo "*****************************************************************" + @echo "*****************************************************************" +endif + +LINPHONE_OPTIONS=enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp) + +build: + make -f builder-iphone-simulator.mk $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin $(LINPHONE_OPTIONS) all \ + && make -f builder-iphone-os.mk delivery-sdk + +ipa: build + make -f builder-iphone-simulator.mk ipa \ + && make -f builder-iphone-os.mk ipa \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin ipa \ + +clean: + make -f builder-iphone-simulator.mk clean \ + && make -f builder-iphone-os.mk clean \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin clean \ + +clean-makefile: + make -f builder-iphone-simulator.mk clean-makefile \ + && make -f builder-iphone-os.mk clean-makefile \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin clean-makefile \ + +veryclean: + make -f builder-iphone-simulator.mk veryclean \ + && make -f builder-iphone-os.mk veryclean \ + && make -f builder-iphone-os.mk host=armv7s-apple-darwin veryclean \ + diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 20797a9f4..a88de3aaa 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -20,7 +20,7 @@ # ############################################################################ -host?=armv6-apple-darwin +host?=armv7-apple-darwin config_site:=iphone-config.site library_mode:= --disable-shared --enable-static linphone_configure_controls= \ @@ -301,13 +301,20 @@ multi-arch: cp -rf $(prefix)/include $(prefix)/../apple-darwin/. ; \ cp -rf $(prefix)/share $(prefix)/../apple-darwin/. ; \ for archive in $$arm_archives ; do \ - i386_path=`echo $$archive | sed -e "s/armv6/i386/"` ;\ - armv7_path=`echo $$archive | sed -e "s/armv6/armv7/"` ;\ - destpath=`echo $$archive | sed -e "s/armv6-//"` ;\ + i386_path=`echo $$archive | sed -e "s/armv7/i386/"` ;\ + armv6_path=`echo $$archive | sed -e "s/armv7/armv6/"` ;\ + if test ! -f "$$armv6_path"; then \ + armv6_path= ; \ + fi; \ + armv7s_path=`echo $$archive | sed -e "s/armv7/armv7s/"` ;\ + if test ! -f "$$armv7s_path"; then \ + armv7s_path= ; \ + fi; \ + destpath=`echo $$archive | sed -e "s/armv7-//"` ;\ if test -f "$$i386_path"; then \ - echo "Mixing $$archive and $$i386_path into $$destpath"; \ + echo "Mixing $$archive into $$destpath"; \ mkdir -p `dirname $$destpath` ; \ - lipo -create $$archive $$armv7_path $$i386_path -output $$destpath; \ + lipo -create $$archive $$armv7s_path $$armv6_path $$i386_path -output $$destpath; \ else \ echo "WARNING: archive `basename $$archive` exists in arm tree but does not exists in i386 tree."; \ fi \ diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index 13e0aa62b..8b65258a9 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -6,6 +6,8 @@ libvpx_configure_options=\ ifneq (,$(findstring armv6,$(host))) libvpx_configure_options+= --target=armv6-darwin-gcc --cpu=arm1176jzf-s +else ifneq (,$(findstring armv7s,$(host))) + libvpx_configure_options+= --target=armv7s-darwin-gcc --cpu=cortex-a8 else ifneq (,$(findstring armv7,$(host))) libvpx_configure_options+= --target=armv7-darwin-gcc --cpu=cortex-a8 else diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch index 390ec4ecf..d651ccfc8 100644 --- a/submodules/build/builders.d/libvpx.patch +++ b/submodules/build/builders.d/libvpx.patch @@ -1,5 +1,5 @@ diff --git a/build/make/configure.sh b/build/make/configure.sh -index 0426f92..24fa04e 100755 +index 0426f92..38fdcb2 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -624,6 +624,9 @@ process_common_toolchain() { @@ -12,7 +12,7 @@ index 0426f92..24fa04e 100755 case ${toolchain} in *-darwin8-*) -@@ -743,6 +746,14 @@ process_common_toolchain() { +@@ -743,9 +746,17 @@ process_common_toolchain() { darwin*) SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer TOOLCHAIN_PATH=${SDK_PATH}/usr/bin @@ -26,10 +26,17 @@ index 0426f92..24fa04e 100755 + fi CC=${TOOLCHAIN_PATH}/gcc AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 -@@ -759,10 +770,10 @@ process_common_toolchain() { +- LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 ++ LD=${TOOLCHAIN_PATH}/gcc + AS=${TOOLCHAIN_PATH}/as + STRIP=${TOOLCHAIN_PATH}/strip + NM=${TOOLCHAIN_PATH}/nm +@@ -757,12 +768,12 @@ process_common_toolchain() { + ASFLAGS="-version -arch ${tgt_isa} -g" + add_cflags -arch ${tgt_isa} - add_ldflags -arch_only ${tgt_isa} +- add_ldflags -arch_only ${tgt_isa} ++ add_ldflags -arch ${tgt_isa} - add_cflags "-isysroot ${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" + add_cflags "-isysroot $SDK_FULL_PATH" @@ -40,3 +47,23 @@ index 0426f92..24fa04e 100755 # Add the paths for the alternate libc for d in usr/include; do +diff --git a/configure b/configure +index 6f20c6b..4638ea2 100755 +--- a/configure ++++ b/configure +@@ -94,6 +94,7 @@ all_platforms="${all_platforms} iwmmxt-linux-gcc" + all_platforms="${all_platforms} iwmmxt2-linux-rvct" + all_platforms="${all_platforms} iwmmxt2-linux-gcc" + all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8 ++all_platforms="${all_platforms} armv7s-darwin-gcc" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8 + all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8 +@@ -198,6 +199,7 @@ ARCH_EXT_LIST=" + armv5te + armv6 + armv7 ++ armv7s + iwmmxt + iwmmxt2 + diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index 4256d17ed..ea15aad82 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -18,16 +18,20 @@ elif test "${host_alias}" = "armv7-apple-darwin" ; then PLATFORM=OS CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" MCPU="-mcpu=cortex-a8" +elif test "${host_alias}" = "armv7s-apple-darwin" ; then + ARCH=armv7s + PLATFORM=OS + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" else echo "bad host ${host_alias} must be either i386-apple-darwin or armv6-apple-darwin" exit fi echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}" - +XCODE_ROOT=/Applications/Xcode.app #new path with Xcode 4.3: -if test -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then - SDK_PATH_LIST=`ls -drt /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` - SDK_BIN_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin +if test -d ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then + SDK_PATH_LIST=`ls -drt ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin else SDK_PATH_LIST=`ls -drt /Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin @@ -44,5 +48,4 @@ AR=${SDK_BIN_PATH}/ar RANLIB=${SDK_BIN_PATH}/ranlib CPPFLAGS="-Dasm=__asm" -LDFLAGS="-Wl,-syslibroot,${SYSROOT_PATH} -framework CFNetwork" OBJCFLAGS="-x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch" diff --git a/submodules/externals/exosip b/submodules/externals/exosip index 1195a20a0..972e9d009 160000 --- a/submodules/externals/exosip +++ b/submodules/externals/exosip @@ -1 +1 @@ -Subproject commit 1195a20a0c61bb90b9b580ca6f394c742236dda8 +Subproject commit 972e9d009e1fe9dc3e2e1d672e39c98de0affa37 diff --git a/submodules/liblinphone.xcodeproj/project.pbxproj b/submodules/liblinphone.xcodeproj/project.pbxproj index 6b9fe6cde..52ba9c37e 100644 --- a/submodules/liblinphone.xcodeproj/project.pbxproj +++ b/submodules/liblinphone.xcodeproj/project.pbxproj @@ -29,7 +29,6 @@ 221DCB6E153584410025E54D /* yuv2rgb.vs in Sources */ = {isa = PBXBuildFile; fileRef = 221DCB6B153584410025E54D /* yuv2rgb.vs */; }; 221DCB6F153584410025E54D /* yuv2rgb.vs in Sources */ = {isa = PBXBuildFile; fileRef = 221DCB6B153584410025E54D /* yuv2rgb.vs */; }; 221F58A013AB50F800D603C9 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 221F589F13AB50F800D603C9 /* CoreMedia.framework */; }; - 221F58A413AB708C00D603C9 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 221F58E413AF44B300D603C9 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 222CA63211F6CF7600621220 /* allfilters.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA5BE11F6CF7600621220 /* allfilters.h */; }; 222CA63311F6CF7600621220 /* dsptools.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA5BF11F6CF7600621220 /* dsptools.h */; }; @@ -113,6 +112,12 @@ 222CA78411F6CFB100621220 /* siplogin.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76211F6CFB100621220 /* siplogin.c */; }; 222CA78511F6CFB100621220 /* sipsetup.c in Sources */ = {isa = PBXBuildFile; fileRef = 222CA76311F6CFB100621220 /* sipsetup.c */; }; 222CA78611F6CFB100621220 /* sipsetup.h in Headers */ = {isa = PBXBuildFile; fileRef = 222CA76411F6CFB100621220 /* sipsetup.h */; }; + 22405EDD160065C200B92522 /* basedescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22405EDC160065C200B92522 /* basedescs.h */; }; + 22405EE01600668800B92522 /* msvoip.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EDF1600668800B92522 /* msvoip.c */; }; + 22405EE2160066C700B92522 /* voipdescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 22405EE1160066C700B92522 /* voipdescs.h */; }; + 22405EE51600671D00B92522 /* logging.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE31600671D00B92522 /* logging.c */; }; + 22405EE61600671D00B92522 /* rtpprofile.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE41600671D00B92522 /* rtpprofile.c */; }; + 22405EE81600675C00B92522 /* genericplc.c in Sources */ = {isa = PBXBuildFile; fileRef = 22405EE71600675C00B92522 /* genericplc.c */; }; 2258C44113A9377B0087A596 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; 2258C44513A945520087A596 /* libswscale.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2258C44213A945520087A596 /* libswscale.a */; }; 2258C44613A945520087A596 /* libavutil.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2258C44313A945520087A596 /* libavutil.a */; }; @@ -191,7 +196,6 @@ 225D64761521BFA6008B2E81 /* linphonecore_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */; }; 225D64781521BFA6008B2E81 /* nowebcam.h in Headers */ = {isa = PBXBuildFile; fileRef = 220ED1AA13A9062500AC21E0 /* nowebcam.h */; }; 225D64791521BFA6008B2E81 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; - 225D647A1521BFA6008B2E81 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 225D647B1521BFA6008B2E81 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 225D647C1521BFA6008B2E81 /* g722.h in Headers */ = {isa = PBXBuildFile; fileRef = 229A614B13DDFE3500090183 /* g722.h */; }; 225D647D1521BFA6008B2E81 /* shaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 70E542F613E14816002BA2C0 /* shaders.h */; }; @@ -339,7 +343,6 @@ 225D65431521C009008B2E81 /* linphonecore_utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 229B9D5813043EAB00EFCD1C /* linphonecore_utils.h */; }; 225D65451521C009008B2E81 /* nowebcam.h in Headers */ = {isa = PBXBuildFile; fileRef = 220ED1AA13A9062500AC21E0 /* nowebcam.h */; }; 225D65461521C009008B2E81 /* swscale.h in Headers */ = {isa = PBXBuildFile; fileRef = 2258C44013A9377B0087A596 /* swscale.h */; }; - 225D65471521C009008B2E81 /* alldescs.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58A313AB708C00D603C9 /* alldescs.h */; }; 225D65481521C009008B2E81 /* scaler.h in Headers */ = {isa = PBXBuildFile; fileRef = 221F58E313AF44B300D603C9 /* scaler.h */; }; 225D65491521C009008B2E81 /* g722.h in Headers */ = {isa = PBXBuildFile; fileRef = 229A614B13DDFE3500090183 /* g722.h */; }; 225D654A1521C009008B2E81 /* shaders.h in Headers */ = {isa = PBXBuildFile; fileRef = 70E542F613E14816002BA2C0 /* shaders.h */; }; @@ -466,7 +469,6 @@ 221F589D13AB503F00D603C9 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = System/Library/Frameworks/CoreVideo.framework; sourceTree = SDKROOT; }; 221F589F13AB50F800D603C9 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 221F58A113AB6F8000D603C9 /* pixconv.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pixconv.c; sourceTree = ""; }; - 221F58A313AB708C00D603C9 /* alldescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = alldescs.h; path = build/iphone/alldescs.h; sourceTree = ""; }; 221F58A513AB716300D603C9 /* tonedetector.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tonedetector.c; sourceTree = ""; }; 221F58A613AB716300D603C9 /* jpegwriter.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jpegwriter.c; sourceTree = ""; }; 221F58A713AB716300D603C9 /* h264dec.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = h264dec.c; sourceTree = ""; }; @@ -639,6 +641,12 @@ 222CA76311F6CFB100621220 /* sipsetup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sipsetup.c; sourceTree = ""; }; 222CA76411F6CFB100621220 /* sipsetup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sipsetup.h; sourceTree = ""; }; 22313679143DED490035C1F4 /* msandroidvideo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = msandroidvideo.cpp; sourceTree = ""; }; + 22405EDC160065C200B92522 /* basedescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = basedescs.h; path = build/iphone/basedescs.h; sourceTree = ""; }; + 22405EDF1600668800B92522 /* msvoip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msvoip.c; sourceTree = ""; }; + 22405EE1160066C700B92522 /* voipdescs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = voipdescs.h; path = build/iphone/voipdescs.h; sourceTree = ""; }; + 22405EE31600671D00B92522 /* logging.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = logging.c; sourceTree = ""; }; + 22405EE41600671D00B92522 /* rtpprofile.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rtpprofile.c; sourceTree = ""; }; + 22405EE71600675C00B92522 /* genericplc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = genericplc.c; sourceTree = ""; }; 224AD571143208BB00510FF3 /* android-display.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "android-display.c"; path = "../../../../../../workspace-android/linphone-android/submodules/linphone/mediastreamer2/src/android-display.c"; sourceTree = ""; }; 224AD57314320EB400510FF3 /* scaler_arm.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = scaler_arm.S; path = "../../../../../../workspace-android/linphone-android/submodules/linphone/mediastreamer2/src/scaler_arm.S"; sourceTree = ""; }; 22512698145F13CE0041FBF2 /* aqsnd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = aqsnd.c; sourceTree = ""; }; @@ -846,8 +854,9 @@ 222CA4CF11F6CF2000621220 /* mediastreamer2 */ = { isa = PBXGroup; children = ( + 22405EE1160066C700B92522 /* voipdescs.h */, + 22405EDC160065C200B92522 /* basedescs.h */, 22B5106813AFD37B00CD87DA /* nowebcamCIF.jpg */, - 221F58A313AB708C00D603C9 /* alldescs.h */, 22DD19E013A8D82C0018ECD4 /* tests */, 222CA5B811F6CF7600621220 /* include */, 222CA5DC11F6CF7600621220 /* src */, @@ -916,6 +925,8 @@ 222CA5DC11F6CF7600621220 /* src */ = { isa = PBXGroup; children = ( + 22405EE71600675C00B92522 /* genericplc.c */, + 22405EDF1600668800B92522 /* msvoip.c */, 221DCB6A153584410025E54D /* yuv2rgb.fs */, 221DCB6B153584410025E54D /* yuv2rgb.vs */, 221DCB6715347EF80025E54D /* opengles_display.c */, @@ -1045,6 +1056,8 @@ 222CA6B611F6CF9F00621220 /* src */ = { isa = PBXGroup; children = ( + 22405EE31600671D00B92522 /* logging.c */, + 22405EE41600671D00B92522 /* rtpprofile.c */, F4D9F23D145710540035B0D0 /* netsim.c */, F4D9F23E145710540035B0D0 /* ortp_srtp.c */, 7014533D13FA841E00A01D86 /* zrtp.c */, @@ -1281,11 +1294,12 @@ 225D64761521BFA6008B2E81 /* linphonecore_utils.h in Headers */, 225D64781521BFA6008B2E81 /* nowebcam.h in Headers */, 225D64791521BFA6008B2E81 /* swscale.h in Headers */, - 225D647A1521BFA6008B2E81 /* alldescs.h in Headers */, 225D647B1521BFA6008B2E81 /* scaler.h in Headers */, 225D647C1521BFA6008B2E81 /* g722.h in Headers */, 225D647D1521BFA6008B2E81 /* shaders.h in Headers */, 225D64811521BFA6008B2E81 /* zrtp.h in Headers */, + 22405EDD160065C200B92522 /* basedescs.h in Headers */, + 22405EE2160066C700B92522 /* voipdescs.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1367,7 +1381,6 @@ 225D65431521C009008B2E81 /* linphonecore_utils.h in Headers */, 225D65451521C009008B2E81 /* nowebcam.h in Headers */, 225D65461521C009008B2E81 /* swscale.h in Headers */, - 225D65471521C009008B2E81 /* alldescs.h in Headers */, 225D65481521C009008B2E81 /* scaler.h in Headers */, 225D65491521C009008B2E81 /* g722.h in Headers */, 225D654A1521C009008B2E81 /* shaders.h in Headers */, @@ -1453,7 +1466,6 @@ 229B9D5913043EAB00EFCD1C /* linphonecore_utils.h in Headers */, 220ED1AC13A9062600AC21E0 /* nowebcam.h in Headers */, 2258C44113A9377B0087A596 /* swscale.h in Headers */, - 221F58A413AB708C00D603C9 /* alldescs.h in Headers */, 221F58E413AF44B300D603C9 /* scaler.h in Headers */, 229A614F13DDFE3500090183 /* g722.h in Headers */, 70E542FA13E14816002BA2C0 /* shaders.h in Headers */, @@ -1658,6 +1670,8 @@ 221DCB6915347EF80025E54D /* opengles_display.c in Sources */, 221DCB6D153584410025E54D /* yuv2rgb.fs in Sources */, 221DCB6F153584410025E54D /* yuv2rgb.vs in Sources */, + 22405EE01600668800B92522 /* msvoip.c in Sources */, + 22405EE81600675C00B92522 /* genericplc.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1690,6 +1704,8 @@ 225D65B41521C009008B2E81 /* zrtp.c in Sources */, 225D65B81521C009008B2E81 /* netsim.c in Sources */, 225D65B91521C009008B2E81 /* ortp_srtp.c in Sources */, + 22405EE51600671D00B92522 /* logging.c in Sources */, + 22405EE61600671D00B92522 /* rtpprofile.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/linphone b/submodules/linphone index e45053170..296b5671a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit e4505317065b76a89665bd1bf07a66ee3972d771 +Subproject commit 296b5671ae42dbfbb28e1c30e8c79ecdbe60ebc5 diff --git a/submodules/mssilk b/submodules/mssilk index f9015a91c..1d81e34d6 160000 --- a/submodules/mssilk +++ b/submodules/mssilk @@ -1 +1 @@ -Subproject commit f9015a91ca056cc5be577dfb78c7c224f1fd77b2 +Subproject commit 1d81e34d6e3234797a726f9e66fc02ac5f28a637