rhodes 5.5.2 → 5.5.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +1 -1
  3. data/CREDITS +3 -3
  4. data/LICENSE +1 -1
  5. data/README.html +1 -1
  6. data/Rakefile +53 -14
  7. data/bin/get-rhodes-info +0 -0
  8. data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
  9. data/lib/build/jake.rb +11 -0
  10. data/lib/commonAPI/barcode/ext/platform/iphone/impl/BarcodeFactory.m +2 -1
  11. data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +4 -0
  12. data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -0
  13. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m +7 -2
  14. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeToolbarSingleton.m +6 -2
  15. data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NavbarSingleton.m +8 -2
  16. data/lib/commonAPI/coreapi/ext/shared/ApplicationImpl.cpp +3 -0
  17. data/lib/commonAPI/coreapi/ext/shared/NetworkImpl.cpp +1 -0
  18. data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
  19. data/lib/commonAPI/coreapi/public/api/rhoapi.js +6 -3
  20. data/lib/commonAPI/mediacapture/ext.yml +1 -2
  21. data/lib/commonAPI/mediacapture/ext/build.bat +8 -0
  22. data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro +82 -0
  23. data/lib/commonAPI/mediacapture/ext/platform/qt/Rakefile +35 -0
  24. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaClosed.png +0 -0
  25. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaOpened.png +0 -0
  26. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/mediacapture.qrc +7 -0
  27. data/lib/commonAPI/mediacapture/ext/platform/qt/resources/photoSave.png +0 -0
  28. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.cpp +83 -0
  29. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.h +54 -0
  30. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogBuilder.h +36 -0
  31. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogController.h +31 -0
  32. data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogView.h +73 -0
  33. data/lib/commonAPI/mediacapture/ext/platform/qt/src/Camera_impl.cpp +337 -0
  34. data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFileNameGetter.h +40 -0
  35. data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFilenameGetterResult.h +36 -0
  36. data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameracrossthreadhalper.h +17 -0
  37. data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameradialogview.cpp +178 -0
  38. data/lib/commonAPI/mediacapture/ext/shared/MediacaptureInit.cpp +8 -8
  39. data/lib/framework/rhodes.rb +1 -1
  40. data/lib/framework/version.rb +1 -1
  41. data/platform/android/Rhodes/AndroidManifest.xml.erb +1 -1
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +9 -2
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +33 -0
  44. data/platform/android/build/android.rake +97 -43
  45. data/platform/android/build/android_studio_project_generator.rb +21 -0
  46. data/platform/android/build/android_tools.rb +8 -6
  47. data/platform/iphone/Classes/AppManager/AppManager.h +6 -0
  48. data/platform/iphone/Classes/AppManager/AppManager.m +76 -37
  49. data/platform/iphone/Classes/MapView/GoogleGeocoder.m +2 -3
  50. data/platform/iphone/Classes/MapView/MapViewController.m +3 -3
  51. data/platform/iphone/Classes/NativeBar.h +1 -0
  52. data/platform/iphone/Classes/NativeBar.m +15 -0
  53. data/platform/iphone/Classes/RhoViewController.m +8 -3
  54. data/platform/iphone/Classes/RhoWKWebView.m +1 -1
  55. data/platform/iphone/Classes/Rhodes.m +55 -38
  56. data/platform/iphone/Classes/SimpleMainView.m +3 -2
  57. data/platform/iphone/Classes/TabbedMainView.h +2 -0
  58. data/platform/iphone/Classes/TabbedMainView.m +15 -3
  59. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
  60. data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +185 -30
  61. data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +105 -6
  62. data/platform/iphone/rbuild/iphone.rake +426 -267
  63. data/platform/iphone/rbuild/putsOverride.rake +8 -0
  64. data/platform/shared/api_generator/iphone/CJSConverter.mm +5 -3
  65. data/platform/shared/common/BundleManager.cpp +16 -6
  66. data/platform/shared/common/PosixThreadImpl.cpp +10 -4
  67. data/platform/shared/common/RhoTime.cpp +81 -40
  68. data/platform/shared/common/RhodesApp.cpp +2 -2
  69. data/platform/shared/common/RhodesApp.h +1 -1
  70. data/platform/shared/db/DBAdapter.cpp +33 -0
  71. data/platform/shared/db/DBAdapter.h +5 -0
  72. data/platform/shared/logging/RhoLogConf.cpp +17 -1
  73. data/platform/shared/logging/RhoLogConf.h +6 -0
  74. data/platform/shared/net/CURLNetRequest.cpp +6 -0
  75. data/platform/shared/net/HttpServer.cpp +27 -1
  76. data/platform/shared/net/INetRequest.cpp +33 -6
  77. data/platform/shared/net/INetRequest.h +2 -0
  78. data/platform/shared/qt/RhoSimulator_dev.pro +14 -10
  79. data/platform/shared/qt/rhodes/QtMainWindow.cpp +2 -2
  80. data/platform/shared/qt/rhodes/iexecutable.h +27 -0
  81. data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +5 -0
  82. data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +3 -0
  83. data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
  84. data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
  85. data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
  86. data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
  87. data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
  88. data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
  89. data/platform/shared/qt/rhodes/resources/rho.png +0 -0
  90. data/platform/shared/qt/rhodes/rhodes.pro +3 -2
  91. data/platform/wm/build/wm.rake +28 -9
  92. data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
  93. data/platform/wm/rhodes/browser/stubs.cpp +5 -0
  94. data/platform/wm/rhodes/rho/net/NetRequestImpl.h +3 -0
  95. data/platform/wm/rhodes/rhodes.vcproj +31 -2
  96. data/rakefile.rb +53 -14
  97. data/res/build-tools/iphonesim/build/Release/iphonesim_8 +2 -2
  98. data/res/generators/rhogen.rb +6 -147
  99. data/res/generators/templates/api/platform/iphone/generated/base_impl/MontanaBase.m +7 -7
  100. data/res/generators/templates/api/platform/iphone/generated/javascript/montana_js_wrap.mm +2 -4
  101. data/res/generators/templates/application/AndroidManifest.erb +1 -1
  102. data/res/generators/templates/application/app/Settings/home.erb +1 -1
  103. data/res/generators/templates/application/build.yml +52 -6
  104. data/res/generators/templates/application/icon/icon.png +0 -0
  105. data/res/generators/templates/application/resources/android/res/drawable-hdpi/ic_notification.png +0 -0
  106. data/res/generators/templates/application/resources/android/res/drawable-hdpi/icon.png +0 -0
  107. data/res/generators/templates/application/resources/android/res/drawable-hdpi/loading.png +0 -0
  108. data/res/generators/templates/application/resources/android/res/drawable-ldpi/ic_notification.png +0 -0
  109. data/res/generators/templates/application/resources/android/res/drawable-ldpi/icon.png +0 -0
  110. data/res/generators/templates/application/resources/android/res/drawable-ldpi/loading.png +0 -0
  111. data/res/generators/templates/application/resources/android/res/drawable-mdpi/ic_notification.png +0 -0
  112. data/res/generators/templates/application/resources/android/res/drawable-mdpi/icon.png +0 -0
  113. data/res/generators/templates/application/resources/android/res/drawable-mdpi/loading.png +0 -0
  114. data/res/generators/templates/application/resources/android/res/drawable-xhdpi/ic_notification.png +0 -0
  115. data/res/generators/templates/application/resources/android/res/drawable-xhdpi/icon.png +0 -0
  116. data/res/generators/templates/application/resources/android/res/drawable-xhdpi/loading.png +0 -0
  117. data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/ic_notification.png +0 -0
  118. data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/icon.png +0 -0
  119. data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/loading.png +0 -0
  120. data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/ic_notification.png +0 -0
  121. data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/icon.png +0 -0
  122. data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/loading.png +0 -0
  123. data/res/generators/templates/application/resources/android/res/drawable/ic_notification.png +0 -0
  124. data/res/generators/templates/application/resources/android/res/drawable/icon.png +0 -0
  125. data/res/generators/templates/application/resources/android/res/drawable/loading.png +0 -0
  126. data/res/generators/templates/application/resources/android/res/mipmap-hdpi/icon.png +0 -0
  127. data/res/generators/templates/application/resources/android/res/mipmap-ldpi/icon.png +0 -0
  128. data/res/generators/templates/application/resources/android/res/mipmap-mdpi/icon.png +0 -0
  129. data/res/generators/templates/application/resources/android/res/mipmap-xhdpi/icon.png +0 -0
  130. data/res/generators/templates/application/resources/android/res/mipmap-xxhdpi/icon.png +0 -0
  131. data/res/generators/templates/application/resources/android/res/mipmap-xxxhdpi/icon.png +0 -0
  132. data/res/generators/templates/application/resources/android/res/mipmap/icon.png +0 -0
  133. data/res/generators/templates/application/{app/loading-568h@2x.png → resources/ios/Default-568h@2x.png} +0 -0
  134. data/res/generators/templates/application/{app/loading-667h@2x.png → resources/ios/Default-667h@2x.png} +0 -0
  135. data/res/generators/templates/application/{app/loading-736h@3x.png → resources/ios/Default-736h@3x.png} +0 -0
  136. data/res/generators/templates/application/{app/loading-Landscape.png → resources/ios/Default-Landscape.png} +0 -0
  137. data/res/generators/templates/application/{app/loading-Landscape@2x.png → resources/ios/Default-Landscape@2x.png} +0 -0
  138. data/res/generators/templates/application/{app/loading-LandscapeLeft.png → resources/ios/Default-LandscapeLeft.png} +0 -0
  139. data/res/generators/templates/application/{app/loading-LandscapeLeft@2x.png → resources/ios/Default-LandscapeLeft@2x.png} +0 -0
  140. data/res/generators/templates/application/{app/loading-LandscapeRight.png → resources/ios/Default-LandscapeRight.png} +0 -0
  141. data/res/generators/templates/application/{app/loading-LandscapeRight@2x.png → resources/ios/Default-LandscapeRight@2x.png} +0 -0
  142. data/res/generators/templates/application/{app/loading-Portrait.png → resources/ios/Default-Portrait.png} +0 -0
  143. data/res/generators/templates/application/{app/loading-Portrait@2x.png → resources/ios/Default-Portrait@2x.png} +0 -0
  144. data/res/generators/templates/application/{app/loading-PortraitUpsideDown.png → resources/ios/Default-PortraitUpsideDown.png} +0 -0
  145. data/res/generators/templates/application/{app/loading-PortraitUpsideDown@2x.png → resources/ios/Default-PortraitUpsideDown@2x.png} +0 -0
  146. data/res/generators/templates/application/resources/ios/Default.png +0 -0
  147. data/res/generators/templates/application/{app/loading@2x.png → resources/ios/Default@2x.png} +0 -0
  148. data/res/generators/templates/application/resources/ios/iTunesArtwork.png +0 -0
  149. data/res/generators/templates/application/resources/ios/iTunesArtwork@2x.png +0 -0
  150. data/res/generators/templates/application/resources/ios/icon114.png +0 -0
  151. data/res/generators/templates/application/resources/ios/icon120.png +0 -0
  152. data/res/generators/templates/application/resources/ios/icon144.png +0 -0
  153. data/res/generators/templates/application/resources/ios/icon152.png +0 -0
  154. data/res/generators/templates/application/resources/ios/icon180.png +0 -0
  155. data/res/generators/templates/application/resources/ios/icon57.png +0 -0
  156. data/res/generators/templates/application/resources/ios/icon60.png +0 -0
  157. data/res/generators/templates/application/resources/ios/icon72.png +0 -0
  158. data/res/generators/templates/application/resources/ios/icon76.png +0 -0
  159. data/res/generators/templates/application/rhoconfig.txt +2 -1
  160. data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +44 -0
  161. data/res/generators/templates/iphone_project/Resources/back_btn.png +0 -0
  162. data/res/generators/templates/iphone_project/Resources/back_btn@2x.png +0 -0
  163. data/res/generators/templates/iphone_project/Resources/back_btn@3x.png +0 -0
  164. data/res/generators/templates/iphone_project/Resources/forward_btn.png +0 -0
  165. data/res/generators/templates/iphone_project/Resources/forward_btn@2x.png +0 -0
  166. data/res/generators/templates/iphone_project/Resources/forward_btn@3x.png +0 -0
  167. data/res/generators/templates/iphone_project/Resources/gears.png +0 -0
  168. data/res/generators/templates/iphone_project/Resources/gears@2x.png +0 -0
  169. data/res/generators/templates/iphone_project/Resources/gears@3x.png +0 -0
  170. data/res/generators/templates/iphone_project/Resources/home_btn.png +0 -0
  171. data/res/generators/templates/iphone_project/Resources/home_btn@2x.png +0 -0
  172. data/res/generators/templates/iphone_project/Resources/home_btn@3x.png +0 -0
  173. data/res/generators/templates/iphone_project/Resources/sync_btn.png +0 -0
  174. data/res/generators/templates/iphone_project/Resources/sync_btn@2x.png +0 -0
  175. data/res/generators/templates/iphone_project/Resources/sync_btn@3x.png +0 -0
  176. data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
  177. data/res/generators/templates/iphone_project/root/Info.plist +0 -7
  178. data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
  179. data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
  180. data/res/generators/templates/iphone_project/root/icon114.png +0 -0
  181. data/res/generators/templates/iphone_project/root/icon120.png +0 -0
  182. data/res/generators/templates/iphone_project/root/icon144.png +0 -0
  183. data/res/generators/templates/iphone_project/root/icon152.png +0 -0
  184. data/res/generators/templates/iphone_project/root/icon180.png +0 -0
  185. data/res/generators/templates/iphone_project/root/icon57.png +0 -0
  186. data/res/generators/templates/iphone_project/root/icon60.png +0 -0
  187. data/res/generators/templates/iphone_project/root/icon72.png +0 -0
  188. data/res/generators/templates/iphone_project/root/icon76.png +0 -0
  189. data/res/generators/templates/project/android_studio_project/app/build.gradle.erb +88 -0
  190. data/res/generators/templates/project/android_studio_project/build.gradle +23 -0
  191. data/res/generators/templates/project/android_studio_project/gradle.properties +17 -0
  192. data/res/generators/templates/project/android_studio_project/gradlew +160 -0
  193. data/res/generators/templates/project/android_studio_project/gradlew.bat +90 -0
  194. data/res/generators/templates/project/android_studio_project/settings.gradle +1 -0
  195. data/rhodes.gemspec +7 -6
  196. data/version +1 -1
  197. metadata +135 -42
  198. data/res/generators/templates/application/icon/icon.svg +0 -22
  199. data/res/generators/templates/application/icon/icon114.png +0 -0
  200. data/res/generators/templates/application/icon/icon120.png +0 -0
  201. data/res/generators/templates/application/icon/icon144.png +0 -0
  202. data/res/generators/templates/application/icon/icon152.png +0 -0
  203. data/res/generators/templates/application/icon/icon180.png +0 -0
  204. data/res/generators/templates/application/icon/icon57.png +0 -0
  205. data/res/generators/templates/application/icon/icon60.png +0 -0
  206. data/res/generators/templates/application/icon/icon72.png +0 -0
  207. data/res/generators/templates/application/icon/icon76.png +0 -0
  208. data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
  209. data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
@@ -93,7 +93,7 @@ extern void rho_geocoding_parse_json_responce(const char* data, char* adress
93
93
  // [url appendString:@"&key="];
94
94
  // [url appendString:gapikey];
95
95
  //}
96
- NSLog(@"Geocoding url = %@\n", url);
96
+ RAWLOG_INFO1("Geocoding url = %s\n", [url UTF8String]);
97
97
  NSURLRequest *request=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
98
98
  cachePolicy:NSURLRequestUseProtocolCachePolicy
99
99
  timeoutInterval:60.0];
@@ -138,11 +138,10 @@ extern void rho_geocoding_parse_json_responce(const char* data, char* adress
138
138
  //[self stringCooridinatesToCLLocation];
139
139
  }
140
140
  @catch (NSException *exception) {
141
- NSLog(@"Geocoding failed");
141
+ RAWLOG_WARNING("Geocoding failed");
142
142
  retvar = FALSE;
143
143
  }
144
144
  @finally {
145
- //NSLog(@"finally");
146
145
  }
147
146
  return retvar;
148
147
  }
@@ -432,7 +432,7 @@ static MapViewController *mc = nil;
432
432
  {
433
433
  MapAnnotation *ann = (MapAnnotation*)[view annotation];
434
434
  NSString* url = [ann url];
435
- NSLog(@"Callout tapped... Url = %@\n", url);
435
+ RAWLOG_INFO1("Callout tapped... Url = %s\n", [url UTF8String]);
436
436
  id<RhoMainView> mainView = [[Rhodes sharedInstance] mainView];
437
437
  [mainView navigateRedirect:url tab:[mainView activeTab]];
438
438
  [self dismissModalViewControllerAnimated:YES];
@@ -476,7 +476,7 @@ static MapViewController *mc = nil;
476
476
  }*/
477
477
 
478
478
  - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
479
- NSLog(@"Reverse Geocoder Errored");
479
+ RAWLOG_ERROR("Reverse Geocoder Errored");
480
480
  }
481
481
 
482
482
  - (void)didFindAddress:(MapAnnotation*)annotation {
@@ -496,7 +496,7 @@ static MapViewController *mc = nil;
496
496
  }
497
497
 
498
498
  - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
499
- NSLog(@"Reverse Geocoder completed");
499
+ RAWLOG_INFO("Reverse Geocoder completed");
500
500
  //mPlacemark=placemark;
501
501
  //[mapView addAnnotation:placemark];
502
502
  }
@@ -42,6 +42,7 @@
42
42
  #define NATIVE_BAR_DETAIL_COLOR @"detailColor"
43
43
  #define NATIVE_BAR_MAX_WIDTH @"maxWidth"
44
44
  #define NATIVE_BAR_FIXED_WIDTH @"fixedWidth"
45
+ #define NATIVE_BAR_TABBAR_INVISIBLE @"invisibleTabControl"
45
46
 
46
47
  #define NATIVE_BAR_ITEM_LABEL @"label"
47
48
  #define NATIVE_BAR_ITEM_DETAIL_LABEL @"detailLabel"
@@ -178,6 +178,8 @@ void rho_create_nativebar_inner(int bar_type, NSArray* p_items, NSDictionary* p_
178
178
  const char* ios_7_icon_color = NULL;
179
179
  const char* ios_7_selected_color = NULL;
180
180
  const char* detail_color = NULL;
181
+ const char* tabbar_invisible = NULL;
182
+
181
183
  NSNumber* nMaxWidth = NULL, *nFixedWidth = NULL;
182
184
 
183
185
  NSObject* obj = nil;
@@ -219,6 +221,16 @@ void rho_create_nativebar_inner(int bar_type, NSArray* p_items, NSDictionary* p_
219
221
  if (obj != nil) {
220
222
  nFixedWidth = (NSNumber*)obj;
221
223
  }
224
+ obj = [p_properties objectForKey:NATIVE_BAR_TABBAR_INVISIBLE];
225
+ if (obj != nil) {
226
+ NSNumber* obj_num = (NSNumber*)obj;
227
+ if ([obj_num boolValue]) {
228
+ tabbar_invisible = "true";
229
+ }
230
+ else {
231
+ tabbar_invisible = "false";
232
+ }
233
+ }
222
234
  }
223
235
 
224
236
  int size = [p_items count];//params->v.array->size;
@@ -432,6 +444,9 @@ void rho_create_nativebar_inner(int bar_type, NSArray* p_items, NSDictionary* p_
432
444
  if (detail_color != NULL) {
433
445
  [properties setObject:[NSString stringWithUTF8String:detail_color] forKey:NATIVE_BAR_DETAIL_COLOR];
434
446
  }
447
+ if (tabbar_invisible != NULL) {
448
+ [properties setObject:[NSString stringWithUTF8String:tabbar_invisible] forKey:NATIVE_BAR_TABBAR_INVISIBLE];
449
+ }
435
450
 
436
451
  //COMMONAPI
437
452
  if (callback != NULL) {
@@ -27,10 +27,15 @@
27
27
  #import "Rhodes.h"
28
28
  #import "RhoViewController.h"
29
29
 
30
+ #import "logging/RhoLog.h"
31
+
32
+ #undef DEFAULT_LOGCATEGORY
33
+ #define DEFAULT_LOGCATEGORY "RhoViewController"
34
+
30
35
  @implementation RhoViewController
31
36
 
32
37
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
33
- //NSLog(@"RVC::%@::shouldAutorotateToInterfaceOrientation",[[self class] description]);
38
+ RAWTRACE1("RVC::%s::shouldAutorotateToInterfaceOrientation", [[[self class] description] UTF8String]);
34
39
  if ([[Rhodes sharedInstance] isRotationLocked])
35
40
  return toInterfaceOrientation == UIInterfaceOrientationPortrait;
36
41
  return YES;
@@ -38,7 +43,7 @@
38
43
 
39
44
  #if defined(__IPHONE_6_0)
40
45
  - (BOOL)shouldAutorotate {
41
- //NSLog(@"RVC::%@::shouldAutorotate",[[self class] description]);
46
+ RAWTRACE1("RVC::%s::shouldAutorotate", [[[self class] description] UTF8String]);
42
47
  if ([[Rhodes sharedInstance] isRotationLocked])
43
48
  return NO;
44
49
 
@@ -79,7 +84,7 @@
79
84
 
80
85
  - (NSUInteger)supportedInterfaceOrientations
81
86
  {
82
- //NSLog(@"RVC::%@::supportedInterfaceOrientations",[[self class] description]);
87
+ RAWTRACE1("RVC::%s::supportedInterfaceOrientations", [[[self class] description] UTF8String]);
83
88
  if ([[Rhodes sharedInstance] isRotationLocked])
84
89
  return UIInterfaceOrientationMaskPortrait;
85
90
  return UIInterfaceOrientationMaskAll;
@@ -94,7 +94,7 @@
94
94
  resultString = [NSString stringWithFormat:@"%@", result];
95
95
  }
96
96
  } else {
97
- NSLog(@"WKWebView.evaluateJavaScript error : %@", error.localizedDescription);
97
+ RAWLOG_ERROR1("WKWebView.evaluateJavaScript error : %s", [[error localizedDescription] UTF8String]);
98
98
  }
99
99
  finished = YES;
100
100
  }];
@@ -648,22 +648,32 @@ static Rhodes *instance = NULL;
648
648
  - (void)doRhoActivate {
649
649
  NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
650
650
  @try {
651
- NSLog(@"doRhoActivate thread started");
651
+ [AppManager startupLogging:@"doRhoActivate thread started"];
652
652
  while (!app_created)
653
653
  [NSThread sleepForTimeInterval:0.1];
654
654
  [Rhodes performOnUiThread:[RhoActivateTask class] wait:NO];
655
655
  }
656
656
  @finally {
657
- NSLog(@"doRhoActivate thread finished");
657
+ [AppManager startupLogging:@"doRhoActivate thread finished"];
658
658
  [pool release];
659
659
  }
660
660
  }
661
661
 
662
662
  - (void)initAppManager {
663
- NSLog(@"Init appManager");
663
+ // log not ready
664
+ [AppManager startupLogging:@"Init appManager"];
665
+
664
666
  appManager = [AppManager instance];
665
- //Configure AppManager
667
+ //Configure AppManager - setup files and symlinks etc.
666
668
  [appManager configure];
669
+
670
+ // log not ready
671
+ [AppManager startupLogging:@"Create rhodes logging and rhoconfig.txt loading"];
672
+ rho_logconf_Init_with_separate_user_path(rho_native_rhopath(), rho_native_rhopath(), "", rho_native_rhouserpath());
673
+ [AppManager startupLogging:@"Create rhodes app"];
674
+ rho_rhodesapp_create_with_separate_user_path(rho_native_rhopath(), rho_native_rhouserpath());
675
+ RAWLOG_INFO("Rhodes started");
676
+
667
677
  }
668
678
 
669
679
  - (void)doRhoInit {
@@ -676,25 +686,28 @@ static Rhodes *instance = NULL;
676
686
 
677
687
  const char *szRootPath = rho_native_rhopath();
678
688
  const char *szUserPath = rho_native_rhouserpath();
689
+
690
+ // Now this methods executed not in separate thread - executed in thread of app's delegate
679
691
  //NSLog(@"Init logconf");
680
692
  //rho_logconf_Init_with_separate_user_path(szRootPath, szRootPath, "", szUserPath);
681
693
  InitMemoryInfoCollector();
682
694
  //NSLog(@"Create rhodes app");
683
695
  //rho_rhodesapp_create_with_separate_user_path(szRootPath, szUserPath);
696
+
684
697
  app_created = YES;
685
698
 
686
699
  rotationLocked = rho_conf_getBool("disable_screen_rotation");
687
700
 
688
- NSLog(@"Init network monitor");
701
+ RAWLOG_INFO("Init network monitor");
689
702
  mNetworkPollCondition = [[NSCondition alloc] init];
690
703
 
691
704
  initNetworkMonitoring();
692
705
  [self performSelectorInBackground:@selector(monitorNetworkStatus) withObject:nil];
693
706
 
694
- NSLog(@"Show loading page");
707
+ RAWLOG_INFO("Show loading page");
695
708
  [self performSelectorOnMainThread:@selector(showLoadingPagePost) withObject:nil waitUntilDone:NO];
696
709
 
697
- NSLog(@"Start rhodes app");
710
+ RAWLOG_INFO("Start rhodes app");
698
711
  rho_rhodesapp_start();
699
712
  rho_rhodesapp_callUiCreatedCallback();
700
713
  [self registerForNotifications];
@@ -741,7 +754,8 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
741
754
  }
742
755
 
743
756
  - (void)doStartUp {
744
- NSLog(@"Rhodes starting application...");
757
+ // log not ready
758
+ [AppManager startupLogging:@"Rhodes starting application..."];
745
759
 
746
760
  [CRhoURLProtocol initAndRegister];
747
761
 
@@ -749,15 +763,17 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
749
763
 
750
764
  const char *szRootPath = rho_native_rhopath();
751
765
  const char *szUserPath = rho_native_rhouserpath();
752
- NSLog(@"Init logconf");
753
- rho_logconf_Init_with_separate_user_path(szRootPath, szRootPath, "", szUserPath);
766
+ //NSLog(@"Init logconf");
767
+
768
+ // now executed in [self initAppManager]
769
+ //rho_logconf_Init_with_separate_user_path(szRootPath, szRootPath, "", szUserPath);
754
770
 
755
771
  [self initAppManager];
756
772
 
757
- NSLog(@"Create new detached thread for initialization stuff");
773
+ RAWLOG_INFO("Create new detached thread for initialization stuff");
758
774
  [NSThread detachNewThreadSelector:@selector(doRhoInit) toTarget:self withObject:nil];
759
775
 
760
- NSLog(@"Init all windows");
776
+ RAWLOG_INFO(@"Init all windows");
761
777
 
762
778
  [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
763
779
 
@@ -799,21 +815,21 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
799
815
 
800
816
  CGRect rrr = [application statusBarFrame];
801
817
 
802
- NSLog(@"Init cookies");
818
+ RAWLOG_INFO("Init cookies");
803
819
  cookies = [[NSMutableDictionary alloc] initWithCapacity:0];
804
820
 
805
821
  // Init controllers
806
- NSLog(@"Init controllers");
822
+ RAWLOG_INFO("Init controllers");
807
823
  logOptionsController = [[LogOptionsController alloc] init];
808
824
  logViewController = [[LogViewController alloc] init];
809
825
 
810
- NSLog(@"Init delegates");
826
+ RAWLOG_INFO("Init delegates");
811
827
  dateTimePickerDelegate = [[DateTimePickerDelegate alloc] init];
812
828
  pickImageDelegate = [[PickImageDelegate alloc] init];
813
829
  signatureDelegate = [SignatureDelegate getSharedInstance];
814
830
  nvDelegate = [[NVDelegate alloc] init];
815
831
 
816
- NSLog(@"Initialization finished");
832
+ RAWLOG_INFO("Initialization finished");
817
833
  }
818
834
 
819
835
  - (void) registerForPushNotificationsInternal:(id<IPushNotificationsReceiver>)receiver;
@@ -887,10 +903,10 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
887
903
  NSEnumerator *enumerator = [do_sync objectEnumerator];
888
904
  id url;
889
905
 
890
- NSLog(@"do_sync array: ");
906
+ RAWLOG_INFO("do_sync array: ");
891
907
  bool sync_all = false;
892
908
  while ( url = [enumerator nextObject] ) {
893
- NSLog( @"url = %@", url );
909
+ RAWLOG_INFO1( "url = %s", [(NSString*)url UTF8String] );
894
910
  if ([@"all" caseInsensitiveCompare:url] == NSOrderedSame) {
895
911
  sync_all = true;
896
912
  } else {
@@ -924,12 +940,12 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
924
940
  } else{
925
941
  soundFilePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:fileName];
926
942
  }
927
- NSLog(@"Playing %@: ", soundFilePath);
943
+ RAWLOG_INFO1("Playing %s: ", [soundFilePath UTF8String]);
928
944
 
929
945
  NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
930
946
  NSError* err = nil;
931
947
  AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&err];
932
- NSLog(@"Init media player returns: %@", err);
948
+ RAWLOG_INFO1("Init media player returns: %s", [[err localizedDescription] UTF8String]);
933
949
 
934
950
  [fileURL release];
935
951
  self.player = newPlayer;
@@ -952,12 +968,12 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
952
968
 
953
969
  - (void) audioPlayerDidFinishPlaying: (AVAudioPlayer *) player successfully: (BOOL) flag {
954
970
  if (flag == YES) {
955
- NSLog(@"Audio player finished playing...");
971
+ RAWLOG_INFO("Audio player finished playing...");
956
972
  }
957
973
  }
958
974
 
959
975
  - (void)audioPlayerDecodeErrorDidOccur:(AVAudioPlayer *)player error:(NSError *)error {
960
- NSLog(@"Audio player decoding error %@", error);
976
+ RAWLOG_INFO1("Audio player decoding error %s", [[error localizedDescription] UTF8String]);
961
977
  }
962
978
 
963
979
 
@@ -970,12 +986,12 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
970
986
 
971
987
 
972
988
  - (void)doStartUpRe:(NSObject*)arg {
973
- NSLog(@"Rhodes starting application...");
989
+ RAWLOG_INFO("Rhodes starting application...");
974
990
  rotationLocked = NO;
975
991
 
976
992
  [self initAppManager];
977
993
 
978
- NSLog(@"Create new detached thread for initialization stuff");
994
+ RAWLOG_INFO("Create new detached thread for initialization stuff");
979
995
  [NSThread detachNewThreadSelector:@selector(doRhoInit) toTarget:self withObject:nil];
980
996
 
981
997
  if (mainView != nil) {
@@ -995,12 +1011,12 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
995
1011
  [window addSubview:mainView.view];
996
1012
  }
997
1013
 
998
- NSLog(@"Init cookies");
1014
+ RAWLOG_INFO("Init cookies");
999
1015
  cookies = [[NSMutableDictionary alloc] initWithCapacity:0];
1000
1016
 
1001
1017
  rho_rhodesapp_canstartapp("", ", ");
1002
1018
 
1003
- NSLog(@"Initialization finished");
1019
+ RAWLOG_INFO("Initialization finished");
1004
1020
  }
1005
1021
 
1006
1022
 
@@ -1036,7 +1052,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1036
1052
  #ifdef APP_BUILD_CAPABILITY_PUSH
1037
1053
  [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
1038
1054
  UIRemoteNotificationType nt = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
1039
- NSLog(@"Enabled notification types: %i", (int)nt);
1055
+ RAWLOG_INFO1("Enabled notification types: %d", (int)nt);
1040
1056
  #else
1041
1057
  [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge)];
1042
1058
  #endif
@@ -1073,7 +1089,8 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1073
1089
 
1074
1090
 
1075
1091
  NSURL* url = [launchOptions objectForKey:UIApplicationLaunchOptionsURLKey];
1076
- NSLog(@"didFinishLaunchingWithOptions: %@", url);
1092
+ // log not ready
1093
+ [AppManager startupLogging:[NSString stringWithFormat:@"didFinishLaunchingWithOptions: %@", [url absoluteString]]];
1077
1094
 
1078
1095
 
1079
1096
  //[self registerForRemoteNotification];
@@ -1099,7 +1116,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1099
1116
  if ( !rho_rhodesapp_canstartapp([start_parameter UTF8String], ", ") )
1100
1117
  {
1101
1118
  //const char* szAppSecToken = get_app_build_config_item("security_token");
1102
- NSLog(@"This is hidden app and can be started only with security key.");
1119
+ RAWLOG_ERROR("This is hidden app and can be started only with security key.");
1103
1120
  /*
1104
1121
  {
1105
1122
 
@@ -1162,7 +1179,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1162
1179
 
1163
1180
  - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
1164
1181
  {
1165
- NSLog(@"PUSH My token is: %@", deviceToken);
1182
+ RAWLOG_INFO1([[NSString stringWithFormat:@"PUSH My token is: %@", deviceToken] UTF8String]);
1166
1183
  if ( pushReceiver != nil ) {
1167
1184
  [pushReceiver onPushRegistrationSucceed:deviceToken];
1168
1185
  }
@@ -1170,7 +1187,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1170
1187
 
1171
1188
  - (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
1172
1189
  {
1173
- NSLog(@"PUSH Failed to get token, error: %@", error);
1190
+ RAWLOG_INFO1([[NSString stringWithFormat:@"PUSH Failed to get token, error: %@", error] UTF8String]);
1174
1191
  if ( pushReceiver != nil ) {
1175
1192
  [pushReceiver onPushRegistrationFailed:error];
1176
1193
  }
@@ -1178,7 +1195,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1178
1195
 
1179
1196
  - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
1180
1197
  {
1181
- NSLog(@"PUSH Received notification: %@", userInfo);
1198
+ RAWLOG_INFO1([[NSString stringWithFormat:@"PUSH Received notification: %@", userInfo] UTF8String]);
1182
1199
  if ( pushReceiver != nil ) {
1183
1200
  [pushReceiver onPushMessageReceived:userInfo];
1184
1201
  }
@@ -1198,7 +1215,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1198
1215
  }
1199
1216
 
1200
1217
  if (!app_created) {
1201
- NSLog(@"Application is not created yet so postpone activation callback");
1218
+ RAWLOG_INFO("Application is not created yet so postpone activation callback");
1202
1219
  [NSThread detachNewThreadSelector:@selector(doRhoActivate) toTarget:self withObject:nil];
1203
1220
  }
1204
1221
  else
@@ -1236,7 +1253,7 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1236
1253
  if ([[UIDevice currentDevice] isMultitaskingSupported]) { //Check if device supports mulitasking
1237
1254
 
1238
1255
  syncBackgroundTask = [app beginBackgroundTaskWithExpirationHandler: ^ {
1239
- NSLog(@"$$$ Background task is terminated by System !!!");
1256
+ RAWLOG_ERROR("$$$ Background task is terminated by System !!!");
1240
1257
 
1241
1258
  // If the background task is already invalid, don't try to end it.
1242
1259
  if (syncBackgroundTask != UIBackgroundTaskInvalid) {
@@ -1245,18 +1262,18 @@ static void displayStatusChanged(CFNotificationCenterRef center, void *observer,
1245
1262
  }
1246
1263
  }];
1247
1264
 
1248
- NSLog(@"Will wait sync thread to finish sync");
1265
+ RAWLOG_INFO("Will wait sync thread to finish sync");
1249
1266
 
1250
1267
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
1251
- NSLog(@"Waiting for sync thread");
1268
+ RAWLOG_INFO("Waiting for sync thread");
1252
1269
 
1253
1270
  do
1254
1271
  {
1255
- NSLog(@"Check sync, rho_rcclient_issyncing = %d", rho_rcclient_issyncing());
1272
+ RAWLOG_INFO1("Check sync, rho_rcclient_issyncing = %d", rho_rcclient_issyncing());
1256
1273
  [NSThread sleepForTimeInterval:1];
1257
1274
  } while (rho_rcclient_issyncing() == 1);
1258
1275
 
1259
- NSLog(@"Sync is finished, rho_rcclient_issyncing = %d", rho_rcclient_issyncing());
1276
+ RAWLOG_INFO1("Sync is finished, rho_rcclient_issyncing = %d", rho_rcclient_issyncing());
1260
1277
 
1261
1278
  // If the background task is already invalid, don't try to end it.
1262
1279
  if (syncBackgroundTask != UIBackgroundTaskInvalid) {
@@ -474,7 +474,8 @@ static BOOL makeHiddenUntilLoadContent = YES;
474
474
  // DO NOT REMOVE THIS LINE!!!
475
475
  // First call of self.view (when self.view is nil) trigger loadView
476
476
  // and viewDidLoad which add all our subviews to the root view
477
- NSLog(@"root view: %@", self.view);
477
+ NSString* s = [NSString stringWithFormat:@"root view: %@", self.view];
478
+ RAWLOG_INFO([s UTF8String]);
478
479
 
479
480
  return self;
480
481
  }
@@ -1016,7 +1017,7 @@ static BOOL makeHiddenUntilLoadContent = YES;
1016
1017
 
1017
1018
  navbar = navb;
1018
1019
  assert([navbar retainCount] == 1);
1019
- NSLog(@"navbar retain count: %d", [navbar retainCount]);
1020
+ RAWLOG_INFO1("navbar retain count: %d", (int)[navbar retainCount]);
1020
1021
  navbar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
1021
1022
  navbar.autoresizesSubviews = YES;
1022
1023
 
@@ -55,12 +55,14 @@
55
55
  int tabindex;
56
56
  id<IMethodResult> on_change_tab_callback;
57
57
  CGRect rootFrame;
58
+ BOOL invisible_tab_control;
58
59
  }
59
60
 
60
61
  @property (nonatomic,retain) UITabBarController *tabbar;
61
62
  @property (nonatomic,retain) NSArray *tabbarData;
62
63
  @property (nonatomic,assign) int tabindex;
63
64
  @property (nonatomic,assign) id<IMethodResult> on_change_tab_callback;
65
+ @property (nonatomic,assign) BOOL invisible_tab_control;
64
66
 
65
67
  - (id)initWithMainView:(id<RhoMainView>)v parent:(UIWindow*)p bar_info:(NSDictionary*)bar_info;
66
68