From da84bc3cbf2010b4f32b98f8b2075427a17a3a7a Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 27 Sep 2010 15:06:26 +0200 Subject: [PATCH] implemet iphone OS 3.x bacward compatibility --- Classes/PhoneViewController.m | 17 +- Classes/PhoneViewController.xib | 397 ++++++++++++++++++++++++++--- Classes/linphoneAppDelegate.m | 10 +- linphone.xcodeproj/project.pbxproj | 8 +- submodules/linphone | 2 +- 5 files changed, 384 insertions(+), 50 deletions(-) diff --git a/Classes/PhoneViewController.m b/Classes/PhoneViewController.m index 5944ea3a3..9bb419530 100644 --- a/Classes/PhoneViewController.m +++ b/Classes/PhoneViewController.m @@ -139,29 +139,41 @@ if (sender == one) { newAddress = [address.text stringByAppendingString:@"1"]; + linphone_core_play_dtmf(mCore, '1', -1); } else if (sender == two) { newAddress = [address.text stringByAppendingString:@"2"]; + linphone_core_play_dtmf(mCore, '2', -1); } else if (sender == three) { newAddress = [address.text stringByAppendingString:@"3"]; + linphone_core_play_dtmf(mCore, '3', -1); } else if (sender == four) { newAddress = [address.text stringByAppendingString:@"4"]; + linphone_core_play_dtmf(mCore, '4', -1); } else if (sender == five) { newAddress = [address.text stringByAppendingString:@"5"]; + linphone_core_play_dtmf(mCore, '5', -1); } else if (sender == six) { newAddress = [address.text stringByAppendingString:@"6"]; + linphone_core_play_dtmf(mCore, '6', -1); } else if (sender == seven) { newAddress = [address.text stringByAppendingString:@"7"]; + linphone_core_play_dtmf(mCore, '7', -1); } else if (sender == eight) { newAddress = [address.text stringByAppendingString:@"8"]; + linphone_core_play_dtmf(mCore, '8', -1); } else if (sender == nine) { newAddress = [address.text stringByAppendingString:@"9"]; + linphone_core_play_dtmf(mCore, '9', -1); } else if (sender == star) { newAddress = [address.text stringByAppendingString:@"*"]; + linphone_core_play_dtmf(mCore, '*', -1); } else if (sender == zero) { newAddress = [address.text stringByAppendingString:@"0"]; + linphone_core_play_dtmf(mCore, '0', -1); //start timer for + [self performSelector:@selector(doKeyZeroLongPress) withObject:nil afterDelay:0.5]; } else if (sender == hash) { + linphone_core_play_dtmf(mCore, '#', -1); newAddress = [address.text stringByAppendingString:@"#"]; } else if (sender == back) { if ([address.text length] >0) { @@ -213,9 +225,8 @@ [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(doKeyZeroLongPress) object:nil]; - } else { - ms_message("unknown up event from dial pad"); - } + } + linphone_core_stop_dtmf(mCore); } -(void)doKeyZeroLongPress { diff --git a/Classes/PhoneViewController.xib b/Classes/PhoneViewController.xib index 442e118b2..7fb6d985b 100644 --- a/Classes/PhoneViewController.xib +++ b/Classes/PhoneViewController.xib @@ -2,17 +2,17 @@ 784 - 10D578 - 762 + 10F569 + 788 1038.29 - 460.00 + 461.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 87 + 117 YES - + YES @@ -853,6 +853,213 @@ 126 + + + doKeyPadUp: + + + 7 + + 127 + + + + doKeyPadUp: + + + 8 + + 128 + + + + doKeyPadUp: + + + 7 + + 129 + + + + doKeyPadUp: + + + 8 + + 130 + + + + doKeyPadUp: + + + 7 + + 131 + + + + doKeyPadUp: + + + 8 + + 132 + + + + doKeyPadUp: + + + 7 + + 133 + + + + doKeyPadUp: + + + 8 + + 134 + + + + doKeyPadUp: + + + 7 + + 135 + + + + doKeyPadUp: + + + 8 + + 136 + + + + doKeyPadUp: + + + 7 + + 137 + + + + doKeyPadUp: + + + 8 + + 138 + + + + doKeyPadUp: + + + 7 + + 139 + + + + doKeyPadUp: + + + 8 + + 140 + + + + doKeyPadUp: + + + 7 + + 141 + + + + doKeyPadUp: + + + 8 + + 142 + + + + doKeyPadUp: + + + 7 + + 143 + + + + doKeyPadUp: + + + 8 + + 144 + + + + doKeyPadUp: + + + 8 + + 145 + + + + doKeyPadUp: + + + 7 + + 146 + + + + doKeyPadUp: + + + 8 + + 147 + + + + doKeyPadUp: + + + 7 + + 148 + + + + doKeyPadUp: + + + 8 + + 149 + @@ -983,6 +1190,7 @@ 107 + hangup 4 @@ -1113,7 +1321,7 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - {{390, 323}, {320, 480}} + {{53, 318}, {320, 480}} com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -1133,7 +1341,7 @@ - 126 + 149 @@ -1156,6 +1364,30 @@ id + + YES + + YES + doAction: + doKeyPad: + doKeyPadUp: + + + YES + + doAction: + id + + + doKeyPad: + id + + + doKeyPadUp: + id + + + YES @@ -1209,6 +1441,125 @@ UIButton + + YES + + YES + address + back + call + callDuration + eight + five + four + hangup + hash + incallView + mute + nine + one + peerLabel + seven + six + speaker + star + status + three + two + zero + + + YES + + address + UITextField + + + back + UIButton + + + call + UIButton + + + callDuration + UILabel + + + eight + UIButton + + + five + UIButton + + + four + UIButton + + + hangup + UIButton + + + hash + UIButton + + + incallView + UIView + + + mute + UIButton + + + nine + UIButton + + + one + UIButton + + + peerLabel + UILabel + + + seven + UIButton + + + six + UIButton + + + speaker + UIButton + + + star + UIButton + + + status + UILabel + + + three + UIButton + + + two + UIButton + + + zero + UIButton + + + IBProjectSource Classes/PhoneViewController.h @@ -1260,13 +1611,6 @@ Foundation.framework/Headers/NSKeyedArchiver.h - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - NSObject @@ -1274,13 +1618,6 @@ Foundation.framework/Headers/NSObject.h - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - NSObject @@ -1288,13 +1625,6 @@ Foundation.framework/Headers/NSRunLoop.h - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - NSObject @@ -1316,13 +1646,6 @@ Foundation.framework/Headers/NSURLConnection.h - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - NSObject @@ -1455,7 +1778,7 @@ com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 @@ -1487,6 +1810,6 @@ {62, 54} - 87 + 117 diff --git a/Classes/linphoneAppDelegate.m b/Classes/linphoneAppDelegate.m index f4c81e21c..3f1523e6b 100644 --- a/Classes/linphoneAppDelegate.m +++ b/Classes/linphoneAppDelegate.m @@ -118,7 +118,7 @@ LinphoneCoreVTable linphonec_vtable = { - (void)applicationDidEnterBackground:(UIApplication *)application { -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 +//#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 struct addrinfo hints; struct addrinfo *res=NULL; @@ -205,7 +205,7 @@ LinphoneCoreVTable linphonec_vtable = { } } -#endif +//#endif } @@ -591,8 +591,8 @@ extern void libmsilbc_init(); , sizeof (audioRouteOverride) , &audioRouteOverride); -#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 - if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { +//#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000 + if (backgroundSupported && [UIApplication sharedApplication].applicationState == UIApplicationStateBackground) { // Create a new notification UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease]; if (notif) @@ -606,7 +606,7 @@ extern void libmsilbc_init(); } } else -#endif +//#endif { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat:@" %@ is calling you",from] delegate:self cancelButtonTitle:@"Decline" destructiveButtonTitle:@"Answer" otherButtonTitles:nil]; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 601c022bc..55c43b379 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -10,7 +10,7 @@ 1D3623260D0F684500981E51 /* linphoneAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* linphoneAppDelegate.m */; }; 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; - 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 22058C71116E305000B08DDD /* icone-linphone-57.png in Resources */ = {isa = PBXBuildFile; fileRef = 22058C70116E305000B08DDD /* icone-linphone-57.png */; }; 220FAD3110765B400068D98F /* libeXosip2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2810765B400068D98F /* libeXosip2.a */; }; 220FAD3210765B400068D98F /* libgsm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2910765B400068D98F /* libgsm.a */; }; @@ -797,7 +797,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; LIBRARY_SEARCH_PATHS = ""; LINK_WITH_STANDARD_LIBRARIES = YES; PREBINDING = NO; @@ -857,7 +857,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; LIBRARY_SEARCH_PATHS = ""; LINK_WITH_STANDARD_LIBRARIES = YES; PREBINDING = NO; @@ -873,7 +873,7 @@ GCC_C_LANGUAGE_STANDARD = c99; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; PREBINDING = NO; SDKROOT = iphoneos4.0; }; diff --git a/submodules/linphone b/submodules/linphone index 6757edcde..69a854529 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 6757edcdeedfd57545e66a3e373d51f5e21c2823 +Subproject commit 69a854529f565dcb321867b3f5e63cd1321b1661