rhodes 3.3.3.beta.3 → 3.3.3.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) hide show
  1. data/Manifest.txt +16 -1
  2. data/Rakefile +77 -28
  3. data/doc/build.txt +5 -3
  4. data/doc/configuration.txt +13 -0
  5. data/doc/device-caps.txt +46 -27
  6. data/doc/rhom.txt +2 -2
  7. data/doc/test-log-debug.txt +6 -0
  8. data/doc/ui.txt +13 -0
  9. data/lib/build/jake.rb +11 -11
  10. data/lib/extensions/crypt/crypt/cbc.rb +5 -2
  11. data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +14 -4
  12. data/lib/framework/rho/render.rb +17 -4
  13. data/lib/framework/rho/rho.rb +1 -1
  14. data/lib/framework/rho/rhocontroller.rb +11 -1
  15. data/lib/framework/rhomotoapi.rb +110 -0
  16. data/platform/android/Rhodes/jni/Android.mk +2 -5
  17. data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +1 -0
  18. data/platform/android/Rhodes/jni/include/rhodes/fileapi.h +38 -0
  19. data/platform/android/Rhodes/jni/src/callbacks.cpp +7 -26
  20. data/platform/android/Rhodes/jni/src/extmanager.cpp +4 -1
  21. data/platform/android/Rhodes/jni/src/fileapi.cpp +38 -14
  22. data/platform/android/Rhodes/jni/src/mapview.cpp +1 -2
  23. data/platform/android/Rhodes/jni/src/rhodesapp.cpp +10 -0
  24. data/platform/android/Rhodes/jni/src/rhodessystem.cpp +1 -1
  25. data/platform/android/Rhodes/jni/src/signature.cpp +1 -4
  26. data/platform/android/Rhodes/rhobundle.xml +1 -1
  27. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +11 -1
  28. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +4 -3
  29. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -6
  30. data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +3 -1
  31. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/AbstractRhoExtension.java +70 -0
  32. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtData.java +3 -1
  33. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtManager.java +21 -7
  34. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/IRhoExtension.java +19 -10
  35. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtDataImpl.java +8 -5
  36. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManager.java +18 -0
  37. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +168 -31
  38. data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +46 -9
  39. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +3 -2
  40. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +27 -53
  41. data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +27 -3
  42. data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/Utils.java +13 -14
  43. data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +12 -5
  44. data/platform/android/build/RhodesSRC_build.files +2 -1
  45. data/platform/android/build/android.rake +48 -17
  46. data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyAPI.java +1 -1
  47. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +24 -3
  48. data/platform/iphone/Classes/AppManager/AppManager.m +1 -1
  49. data/platform/iphone/Classes/Camera/PickImageDelegate.m +27 -2
  50. data/platform/iphone/Classes/DateTimePickerDelegate.h +2 -0
  51. data/platform/iphone/Classes/DateTimePickerDelegate.m +85 -9
  52. data/platform/iphone/Classes/DateTimePickerViewController.h +21 -0
  53. data/platform/iphone/Classes/DateTimePickerViewController.m +75 -0
  54. data/platform/iphone/Classes/GeoLocation/LocationController.h +6 -2
  55. data/platform/iphone/Classes/GeoLocation/LocationController.m +54 -14
  56. data/platform/iphone/Classes/RhoMainView.h +2 -0
  57. data/platform/iphone/Classes/Rhodes.m +11 -5
  58. data/platform/iphone/Classes/Signature/SignatureDelegate.m +13 -12
  59. data/platform/iphone/Classes/Signature/SignatureViewController.m +2 -1
  60. data/platform/iphone/Classes/SimpleMainView.m +3 -0
  61. data/platform/iphone/Classes/SplitView/SplittedMainView.m +3 -0
  62. data/platform/iphone/Classes/TabbedMainView.m +30 -11
  63. data/platform/iphone/rbuild/iphone.rake +7 -1
  64. data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
  65. data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +1 -1
  66. data/platform/shared/common/BundleManager.cpp +42 -2
  67. data/platform/shared/common/ExtManager.h +7 -0
  68. data/platform/shared/common/RhoFile.cpp +170 -2
  69. data/platform/shared/common/RhoFile.h +4 -0
  70. data/platform/shared/common/RhodesApp.cpp +30 -0
  71. data/platform/shared/common/RhodesApp.h +1 -0
  72. data/platform/shared/common/map/OSMMapEngine.cpp +11 -3
  73. data/platform/shared/common/map/OSMMapEngine.h +3 -0
  74. data/platform/shared/logging/RhoLogConf.cpp +8 -9
  75. data/platform/shared/logging/RhoLogConf.h +5 -7
  76. data/platform/shared/logging/RhoLogSink.cpp +3 -3
  77. data/platform/shared/logging/RhoLogSink.h +1 -1
  78. data/platform/shared/net/HttpServer.cpp +17 -9
  79. data/platform/shared/qt/rhodes/main.cpp +1 -1
  80. data/platform/shared/ruby/ext/rho/rhoruby.c +4 -0
  81. data/platform/shared/ruby/ext/webview/webview.i +9 -4
  82. data/platform/shared/ruby/ext/webview/webview_wrap.c +2 -2
  83. data/platform/shared/test/Tests.cpp +2 -2
  84. data/platform/wm/build/build_inf.js +75 -47
  85. data/platform/wm/build/wm.rake +50 -53
  86. data/platform/wm/rhodes/Rhodes.cpp +40 -97
  87. data/platform/wm/rhodes/rho/common/ExtManager.cpp +23 -1
  88. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +9 -0
  89. data/platform/wm/tools/detool/detool.cpp +103 -52
  90. data/platform/wp7/RhoRubyExtGen/RhoDateTimePicker.cs +60 -0
  91. data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +1 -0
  92. data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +4 -4
  93. data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +15 -1
  94. data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +12 -2
  95. data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +2 -0
  96. data/platform/wp7/RhoRubyLib/common/RhoFile.cs +3 -3
  97. data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +2 -2
  98. data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +39 -24
  99. data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +8 -1
  100. data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +3 -3
  101. data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +1 -1
  102. data/platform/wp7/RhoRubyLib/net/HttpServer.cs +22 -15
  103. data/platform/wp7/RhoRubyLib/net/NetRequest.cs +1 -1
  104. data/platform/wp7/RhoRubyLib/rubyext/RhoDateTimePicker.cs +237 -0
  105. data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +5 -5
  106. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml +37 -0
  107. data/platform/wp7/RhoRubyLib/views/RhoDateTimeDlg.xaml.cs +59 -0
  108. data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +34 -41
  109. data/platform/wp7/rhodes/App.xaml.cs +1 -0
  110. data/platform/wp7/rhodes/Properties/WMAppManifest.xml +18 -18
  111. data/platform/wp7/rhodes/Rhodes.csproj +5 -1
  112. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Cancel.png +0 -0
  113. data/platform/wp7/rhodes/Toolkit.Content/ApplicationBar.Check.png +0 -0
  114. data/rakefile.rb +77 -28
  115. data/res/build-tools/Microsoft.Phone.Controls.Toolkit.dll +0 -0
  116. data/res/build-tools/YUICompressorLicense.txt +54 -0
  117. data/res/build-tools/detool.exe +0 -0
  118. data/res/build-tools/yuicompressor-2.4.7.jar +0 -0
  119. data/res/generators/templates/application/app/layout.erb +1 -0
  120. data/res/generators/templates/application/public/js/jquery-wp7-patch.js +8 -2
  121. data/res/generators/templates/application/public/js/syncengine.js +147 -0
  122. data/spec/phone_spec/app/Data/septest.json +1 -1
  123. data/spec/phone_spec/app/spec/asynchttp_spec.rb +11 -10
  124. data/spec/phone_spec/app/spec/blobsync_spec.rb +9 -34
  125. data/spec/phone_spec/app/spec/date_spec.rb +6 -6
  126. data/spec/phone_spec/app/spec/rho_spec.rb +1 -6
  127. data/spec/phone_spec/app/spec/rhofile_spec.rb +13 -7
  128. data/spec/phone_spec/app/spec/rhom_object_spec.rb +4 -3
  129. data/spec/phone_spec/app/spec/syncengine_spec.rb +12 -14
  130. data/spec/phone_spec/app/spec_runner.rb +9 -10
  131. data/version +1 -1
  132. metadata +20 -5
  133. data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerSingleton.java +0 -15
@@ -27,6 +27,8 @@ static void _TimerCallBack(CFRunLoopTimerRef timer, void* context);
27
27
  // This is a singleton class, see below
28
28
  static LocationController *sharedLC = nil;
29
29
 
30
+
31
+ /*
30
32
  @interface LocationManagerInit : NSObject {}
31
33
  + (void)run;
32
34
  @end
@@ -36,19 +38,23 @@ static LocationController *sharedLC = nil;
36
38
  [[LocationController sharedInstance] initLocationManager];
37
39
  }
38
40
  @end
39
-
41
+ */
40
42
 
41
43
  @implementation LocationController
42
44
 
43
45
  @synthesize _locationManager;
44
- @synthesize onUpdateLocation;
46
+ //@synthesize onUpdateLocation;
45
47
 
46
48
  - (bool)update{
47
49
  if (!_locationManager)
48
50
  return false;
49
- if (!_locationManager.locationServicesEnabled) {
51
+ if (!_locationManager.locationServicesEnabled)
50
52
  return false;
51
- }
53
+ if (![CLLocationManager locationServicesEnabled])
54
+ return false;
55
+ if (([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) &&
56
+ ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusNotDetermined) )
57
+ return false;
52
58
  if (_timer==NULL) {
53
59
  _timer = CFRunLoopTimerCreate(NULL,
54
60
  CFAbsoluteTimeGetCurrent() + timeOutInSeconds,
@@ -74,7 +80,7 @@ static LocationController *sharedLC = nil;
74
80
  [self update];
75
81
  }
76
82
 
77
- - (void) initLocationManager {
83
+ - (void) initLocationManager:(NSObject*)param {
78
84
  int timeout = rho_conf_getInt("geo_location_inactivity_timeout");
79
85
  if (timeout == 0)
80
86
  timeout = RHO_GEO_LOCATION_INACTIVITY_TIMEOUT;
@@ -87,14 +93,16 @@ static LocationController *sharedLC = nil;
87
93
  - (id) init {
88
94
  self = [super init];
89
95
  if (self != nil) {
90
- [Rhodes performOnUiThread:[LocationManagerInit class] wait:NO];
91
-
92
- self.onUpdateLocation = @selector(doUpdateLocation);
96
+ //[Rhodes performOnUiThread:[LocationManagerInit class] wait:YES];
97
+ [self performSelectorOnMainThread:@selector(initLocationManager:) withObject:nil waitUntilDone:YES];
98
+
99
+
100
+ //self.onUpdateLocation = @selector(doUpdateLocation);
93
101
  _dLatitude = 0;
94
102
  _dLongitude = 0;
95
103
  _dAccuracy = 0;
96
104
  _bKnownPosition = false;
97
-
105
+ isErrorState = false;
98
106
  RAWLOG_INFO("init");
99
107
 
100
108
  }
@@ -140,7 +148,6 @@ static LocationController *sharedLC = nil;
140
148
 
141
149
  if ( bNotify )
142
150
  rho_geo_callcallback();
143
-
144
151
  }
145
152
 
146
153
  - (double) getLatitude{
@@ -179,8 +186,22 @@ static LocationController *sharedLC = nil;
179
186
 
180
187
  - (bool) isAvailable{
181
188
  bool res = false;
182
- @synchronized(self){
183
- res = _locationManager &&_locationManager.locationServicesEnabled;
189
+
190
+ //bool service_enabled = false;
191
+ //bool service_enabled_f = false;
192
+ //int auth_status = -1;
193
+
194
+ @synchronized(self){
195
+
196
+ //if (_locationManager) {
197
+ // service_enabled = _locationManager.locationServicesEnabled;
198
+ // service_enabled_f = [CLLocationManager locationServicesEnabled];
199
+ // auth_status = [CLLocationManager authorizationStatus];
200
+ //}
201
+ res = _locationManager &&
202
+ _locationManager.locationServicesEnabled &&
203
+ [CLLocationManager locationServicesEnabled] &&
204
+ ( ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized ) || ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined ) );
184
205
  }
185
206
  return res;
186
207
  }
@@ -188,8 +209,20 @@ static LocationController *sharedLC = nil;
188
209
  - (void)locationManager:(CLLocationManager *)manager
189
210
  didFailWithError:(NSError *)error
190
211
  {
191
- RAWLOG_ERROR("Error reading location");
212
+ /*
213
+ if (error != nil) {
214
+ const char* description = [[error localizedDescription] UTF8String];
215
+ const char* reason = [[error localizedFailureReason] UTF8String];
216
+
217
+ int o = 0;
218
+ o = 9;
219
+ }
220
+ */
221
+ isErrorState = true;
222
+ _bKnownPosition = false;
223
+ RAWLOG_ERROR("Error in GeoLocation");
192
224
  rho_geo_callcallback_error();
225
+ isErrorState = false;
193
226
  }
194
227
 
195
228
  + (LocationController *)sharedInstance {
@@ -232,6 +265,13 @@ static LocationController *sharedLC = nil;
232
265
  return self;
233
266
  }
234
267
 
268
+ - (void) runUpdateInMainThread
269
+ {
270
+ if (!isErrorState) {
271
+ [self performSelectorOnMainThread:@selector(doUpdateLocation) withObject:nil waitUntilDone:NO];
272
+ }
273
+ }
274
+
235
275
  @end
236
276
 
237
277
  /* static */ void
@@ -244,7 +284,7 @@ void geo_update() {
244
284
  if (!rho_rhodesapp_check_mode())
245
285
  return;
246
286
  LocationController *loc = [LocationController sharedInstance];
247
- [loc performSelectorOnMainThread:[loc onUpdateLocation] withObject:nil waitUntilDone:NO];
287
+ [loc runUpdateInMainThread];
248
288
  }
249
289
 
250
290
  double rho_geo_latitude() {
@@ -56,4 +56,6 @@
56
56
  -(void)closeNativeView:(int)tab_index;
57
57
 
58
58
  -(void)setTabBarBadge:(NSString*)badge_text tab_index:(int)tab_index;
59
+
60
+ -(UIViewController*)getMainViewController;
59
61
  @end
@@ -349,7 +349,8 @@ static Rhodes *instance = NULL;
349
349
  picker.cameraDevice = UIImagePickerControllerCameraDeviceFront;
350
350
  }
351
351
 
352
- [window addSubview:picker.view];
352
+ //[window addSubview:picker.view];
353
+ [[mainView getMainViewController] presentModalViewController:picker animated:NO];
353
354
  }
354
355
  } @catch(NSException* theException) {
355
356
  RAWLOG_ERROR2("startCameraPickerFromViewController failed(%s): %s", [[theException name] UTF8String], [[theException reason] UTF8String] );
@@ -382,9 +383,14 @@ static Rhodes *instance = NULL;
382
383
  rect.origin.y = 0;
383
384
  SignatureViewController* svc = [[SignatureViewController alloc] initWithRect:rect delegate:signatureDelegate];
384
385
  [signatureDelegate setSignatureViewControllerValue:svc];
385
- [mainView.view retain];
386
- [mainView.view removeFromSuperview];
387
- [window addSubview:svc.view];
386
+
387
+ [[mainView getMainViewController] presentModalViewController:svc animated:YES];
388
+
389
+
390
+
391
+ //[mainView.view retain];
392
+ //[mainView.view removeFromSuperview];
393
+ //[window addSubview:svc.view];
388
394
  } @catch(NSException* theException) {
389
395
  RAWLOG_ERROR2("startSignatureViewController failed(%s): %s", [[theException name] UTF8String], [[theException reason] UTF8String] );
390
396
  }
@@ -567,7 +573,7 @@ static Rhodes *instance = NULL;
567
573
  const char *szRootPath = rho_native_rhopath();
568
574
  const char *szUserPath = rho_native_rhouserpath();
569
575
  NSLog(@"Init logconf");
570
- rho_logconf_Init_with_separate_user_path(szRootPath, "", szUserPath);
576
+ rho_logconf_Init_with_separate_user_path(szRootPath, szRootPath, "", szUserPath);
571
577
  NSLog(@"Create rhodes app");
572
578
  rho_rhodesapp_create_with_separate_user_path(szRootPath, szUserPath);
573
579
  app_created = YES;
@@ -130,24 +130,25 @@ SignatureDelegate* ourSD = nil;
130
130
  }
131
131
 
132
132
  -(void)doDone:(UIImage*)image {
133
-
133
+ [[[[Rhodes sharedInstance] mainView] getMainViewController] dismissModalViewControllerAnimated:YES];
134
134
  [self useImage:image];
135
- [signatureViewController.view removeFromSuperview];
135
+ //[signatureViewController.view removeFromSuperview];
136
136
  [signatureViewController release];
137
137
  signatureViewController = nil;
138
- [parentView addSubview:prevView];
139
- [prevView release];
140
- prevView = nil;
138
+ //[parentView addSubview:prevView];
139
+ //[prevView release];
140
+ //prevView = nil;
141
141
  [image release];
142
142
  }
143
143
 
144
144
  -(void)doCancel {
145
+ [[[[Rhodes sharedInstance] mainView] getMainViewController] dismissModalViewControllerAnimated:YES];
145
146
  rho_rhodesapp_callSignatureCallback([postUrl UTF8String], "", "", 1);
146
- [signatureViewController.view removeFromSuperview];
147
+ //[signatureViewController.view removeFromSuperview];
147
148
  [signatureViewController release];
148
149
  signatureViewController = nil;
149
- [parentView addSubview:prevView];
150
- [prevView release];
150
+ //[parentView addSubview:prevView];
151
+ //[prevView release];
151
152
  prevView = nil;
152
153
  }
153
154
 
@@ -257,11 +258,11 @@ void rho_signature_take(char* callback_url, rho_param* p) {
257
258
  if (!image_format)
258
259
  image_format = "png";
259
260
  if (!penColor)
260
- penColor = "0xFF66009A";
261
+ penColor = "4284874906";
261
262
  if (!penWidth)
262
263
  penWidth = "3";
263
264
  if (!bgColor)
264
- bgColor = "0xFFFFFFFF";
265
+ bgColor = "4294967295";
265
266
 
266
267
 
267
268
 
@@ -330,11 +331,11 @@ void rho_signature_visible(bool b, rho_param* p)
330
331
  if (!image_format)
331
332
  image_format = "png";
332
333
  if (!penColor)
333
- penColor = "0xFF66009A";
334
+ penColor = "4284874906";
334
335
  if (!penWidth)
335
336
  penWidth = "3";
336
337
  if (!bgColor)
337
- bgColor = "0xFFFFFFFF";
338
+ bgColor = "4294967295";
338
339
  if (!left)
339
340
  left = "0";
340
341
  if (!top)
@@ -81,6 +81,7 @@
81
81
 
82
82
  }
83
83
 
84
+ self.view.autoresizesSubviews = YES;
84
85
 
85
86
  [toolbar sizeToFit];
86
87
  CGRect srect = self.view.frame;
@@ -93,7 +94,7 @@
93
94
  toolbar.frame = trect;
94
95
  toolbar.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth;
95
96
 
96
- signatureView = [[SignatureView alloc] initWithFrame:CGRectZero];
97
+ signatureView = [[SignatureView alloc] initWithFrame:srect];
97
98
  signatureView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
98
99
  signatureView.autoresizesSubviews = YES;
99
100
  signatureView.frame = srect;
@@ -719,6 +719,9 @@ static BOOL makeHiddenUntilLoadContent = YES;
719
719
  [self restoreWebView];
720
720
  }
721
721
 
722
+ -(UIViewController*)getMainViewController {
723
+ return self;
724
+ }
722
725
 
723
726
 
724
727
  - (NSString*)processForNativeView:(NSString*)url {
@@ -257,6 +257,9 @@
257
257
  }
258
258
 
259
259
 
260
+ -(UIViewController*)getMainViewController {
261
+ return self;
262
+ }
260
263
 
261
264
 
262
265
  - (void)switchTab:(int)index {
@@ -85,8 +85,14 @@
85
85
  int bitmapByteCount;
86
86
  int bitmapBytesPerRow;
87
87
 
88
- size_t pixelsWide = 1;
89
- size_t pixelsHigh = height;
88
+ float scale = 1.0;
89
+
90
+ if (([[UIScreen mainScreen] respondsToSelector:@selector(scale)])) {
91
+ scale = [UIScreen mainScreen].scale;
92
+ }
93
+
94
+ size_t pixelsWide = 2;
95
+ size_t pixelsHigh = height*scale;
90
96
 
91
97
  bitmapBytesPerRow = (pixelsWide) << 2;
92
98
  bitmapByteCount = (bitmapBytesPerRow * pixelsHigh);
@@ -94,7 +100,7 @@
94
100
  colorSpace = CGColorSpaceCreateDeviceRGB();//CGColorSpaceCreateDeviceGray();//(kCGColorSpaceGenericRGB);
95
101
 
96
102
  bitmapData = malloc( bitmapByteCount );
97
-
103
+
98
104
  context = CGBitmapContextCreate (bitmapData,
99
105
  pixelsWide,
100
106
  pixelsHigh,
@@ -137,9 +143,9 @@
137
143
  if (color12_b > 1) color12_b = 1;
138
144
 
139
145
  int y0 =0;
140
- int y1 = ((float)height)*0.5;
141
- int y2 = ((float)height)*0.5;
142
- int y3 = (float)height;
146
+ int y1 = ((float)pixelsHigh)*0.5;
147
+ int y2 = ((float)pixelsHigh)*0.5;
148
+ int y3 = (float)pixelsHigh;
143
149
 
144
150
  rect.origin.x = 0;
145
151
  rect.origin.y = y0;
@@ -184,7 +190,7 @@
184
190
 
185
191
  CGImageRef cgImage = CGBitmapContextCreateImage(context);
186
192
 
187
- UIImage* ui = [UIImage imageWithCGImage:cgImage];
193
+ UIImage* ui = [UIImage imageWithCGImage:cgImage scale:scale orientation:UIImageOrientationUp];
188
194
 
189
195
  CGContextRelease(context);
190
196
 
@@ -203,14 +209,14 @@
203
209
  int cR = (self.bkgColor & 0xFF0000) >> 16;
204
210
  int cG = (self.bkgColor & 0xFF00) >> 8;
205
211
  int cB = (self.bkgColor & 0xFF);
206
-
207
- UIImage *i = [self makeUIImageWithGradient:(int)frame.size.height colorR:cR colorG:cG colorB:cB];
212
+
213
+ UIImage *i = [self makeUIImageWithGradient:(int)(frame.size.height) colorR:cR colorG:cG colorB:cB];
208
214
 
209
215
  UIColor *c = [[UIColor alloc] initWithPatternImage:i];
210
216
  v.backgroundColor = c;
211
217
  v.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
212
218
  [c release];
213
- [[self tabBar] insertSubview:v atIndex:0];
219
+ [[self tabBar] insertSubview:v atIndex:1];
214
220
  [v release];
215
221
 
216
222
  }
@@ -269,7 +275,15 @@
269
275
  CGPoint itemImagePosition;
270
276
  itemImagePosition.x = ceilf((contextRect.size.width - itemImageSize.width) / 2);
271
277
  itemImagePosition.y = ceilf((contextRect.size.height - itemImageSize.height) / 2);
272
- UIGraphicsBeginImageContext(contextRect.size);
278
+
279
+
280
+ float scale = image.scale;
281
+
282
+ //if (([[UIScreen mainScreen] respondsToSelector:@selector(scale)])) {
283
+ // scale = [UIScreen mainScreen].scale;
284
+ //}
285
+
286
+ UIGraphicsBeginImageContextWithOptions(contextRect.size, NO, scale);
273
287
  CGContextRef c = UIGraphicsGetCurrentContext();
274
288
 
275
289
  CGContextSetShadowWithColor(c, shadowOffset, shadowBlur, cgShadowColor);
@@ -579,6 +593,11 @@
579
593
  [self onSwitchTab];
580
594
  }
581
595
 
596
+ -(UIViewController*)getMainViewController {
597
+ return self;
598
+ }
599
+
600
+
582
601
  - (void)onSwitchTab {
583
602
  int new_index = tabbar.selectedIndex;
584
603
  RhoTabBarData *td = [self tabData:new_index];
@@ -801,7 +801,13 @@ namespace "run" do
801
801
 
802
802
  io.each do |line|
803
803
  puts line
804
- $iphone_end_spec = !Jake.process_spec_output(line)
804
+
805
+ if line.class.method_defined? "valid_encoding?"
806
+ $iphone_end_spec = !Jake.process_spec_output(line) if line.valid_encoding?
807
+ else
808
+ $iphone_end_spec = !Jake.process_spec_output(line)
809
+ end
810
+
805
811
  break if $iphone_end_spec
806
812
  end
807
813
  io.close
@@ -70,6 +70,7 @@
70
70
  F5B8FAD40F44EA7B00C9AF85 /* PickImageDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F5B8FAD30F44EA7B00C9AF85 /* PickImageDelegate.m */; };
71
71
  F5F06668102CB134006CFD39 /* ParamsWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F5F06667102CB134006CFD39 /* ParamsWrapper.m */; };
72
72
  F5FD0944106151C200B7B8ED /* MapViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FD0943106151C200B7B8ED /* MapViewController.m */; };
73
+ FA14CECD150130DB00734801 /* DateTimePickerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA14CECC150130DB00734801 /* DateTimePickerViewController.m */; };
73
74
  FA291E9811FF2EF70096AC39 /* SignatureDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FA291E9511FF2EF70096AC39 /* SignatureDelegate.m */; };
74
75
  FA291E9911FF2EF70096AC39 /* SignatureViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FA291E9711FF2EF70096AC39 /* SignatureViewController.m */; };
75
76
  FA3C79AE136ED523002302E5 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FA3C79AD136ED523002302E5 /* CoreVideo.framework */; };
@@ -265,6 +266,8 @@
265
266
  F5F06667102CB134006CFD39 /* ParamsWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ParamsWrapper.m; sourceTree = "<group>"; };
266
267
  F5FD0942106151C200B7B8ED /* MapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MapViewController.h; path = MapView/MapViewController.h; sourceTree = "<group>"; };
267
268
  F5FD0943106151C200B7B8ED /* MapViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MapViewController.m; path = MapView/MapViewController.m; sourceTree = "<group>"; };
269
+ FA14CECB150130DB00734801 /* DateTimePickerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DateTimePickerViewController.h; sourceTree = "<group>"; };
270
+ FA14CECC150130DB00734801 /* DateTimePickerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DateTimePickerViewController.m; sourceTree = "<group>"; };
268
271
  FA291E9411FF2EF70096AC39 /* SignatureDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureDelegate.h; path = Signature/SignatureDelegate.h; sourceTree = "<group>"; };
269
272
  FA291E9511FF2EF70096AC39 /* SignatureDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SignatureDelegate.m; path = Signature/SignatureDelegate.m; sourceTree = "<group>"; };
270
273
  FA291E9611FF2EF70096AC39 /* SignatureViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SignatureViewController.h; path = Signature/SignatureViewController.h; sourceTree = "<group>"; };
@@ -450,6 +453,8 @@
450
453
  46B005F51033690F00D0C2F4 /* DateTime.h */,
451
454
  46B005F61033690F00D0C2F4 /* DateTime.m */,
452
455
  BD97ACA611610666006960F9 /* DateTimePicker.m */,
456
+ FA14CECB150130DB00734801 /* DateTimePickerViewController.h */,
457
+ FA14CECC150130DB00734801 /* DateTimePickerViewController.m */,
453
458
  );
454
459
  name = DateTimePicker;
455
460
  sourceTree = "<group>";
@@ -1002,6 +1007,7 @@
1002
1007
  FA522E8112DEA7B300AB55CC /* RhoNativeViewManager.mm in Sources */,
1003
1008
  FA52300D12E4BBC700AB55CC /* MapViewManager.m in Sources */,
1004
1009
  FAC6EE6D143B3AF100B8E352 /* RhoMapViewController.m in Sources */,
1010
+ FA14CECD150130DB00734801 /* DateTimePickerViewController.m in Sources */,
1005
1011
  );
1006
1012
  runOnlyForDeploymentPostprocessing = 0;
1007
1013
  };
@@ -140,7 +140,7 @@ void rho_connectclient_processmodels(RHOM_MODEL* pModels, int nModels)
140
140
 
141
141
  void rho_connectclient_init(RHOM_MODEL* pModels, int nModels)
142
142
  {
143
- rho_logconf_Init(rho_native_rhopath(), "");
143
+ rho_logconf_Init(rho_native_rhopath(), rho_native_rhopath(), "");
144
144
  CRhodesAppBase::Create( rho_native_rhopath(), rho_native_rhopath(), rho_native_rhopath() );
145
145
 
146
146
  String strDbPath = rho_native_rhopath();
@@ -36,12 +36,19 @@ using namespace rho;
36
36
  using namespace rho::common;
37
37
  extern "C" void rho_sys_app_exit();
38
38
  extern "C" void rho_sys_impl_exit_with_errormessage(const char* szTitle, const char* szMsg);
39
+ extern "C" void rho_sys_impl_before_exit();
39
40
 
40
41
  #if !defined(OS_WINDOWS) && !defined(OS_WINCE) && !defined(OS_MACOSX)
41
42
  void rho_sys_impl_exit_with_errormessage(const char* szTitle, const char* szMsg)
42
43
  {
43
44
  }
44
45
  #endif
46
+ #if !defined(OS_ANDROID)
47
+ extern "C"
48
+ void rho_sys_impl_before_exit()
49
+ {
50
+ }
51
+ #endif
45
52
 
46
53
  namespace rho {
47
54
  namespace common {
@@ -95,8 +102,13 @@ CFileTransaction::CFileTransaction(const String& strFolder) : m_strFolder(strFol
95
102
 
96
103
  unsigned int CFileTransaction::start()
97
104
  {
105
+ LOG(TRACE) + "FileTransaction is starting: " + m_strFolder;
106
+ LOG(TRACE) + "Creating folder" + m_strFolder + "_temp_journal";
107
+
98
108
  CRhoFile::createFolder((m_strFolder + "_temp_journal").c_str());
99
109
 
110
+ LOG(TRACE) + "Coping: " + CFilePath::join(m_strFolder, "") + " -> " + m_strFolder + "_temp_journal";
111
+
100
112
  m_nError = CRhoFile::copyFoldersContentToAnotherFolder( CFilePath::join(m_strFolder, "").c_str(), (m_strFolder + "_temp_journal").c_str() );
101
113
  if (m_nError)
102
114
  {
@@ -104,6 +116,8 @@ unsigned int CFileTransaction::start()
104
116
  return m_nError;
105
117
  }
106
118
 
119
+ LOG(TRACE) + "Renaming: " + m_strFolder + "_temp_journal" + " -> " + m_strFolder + "_journal";
120
+
107
121
  m_nError = CRhoFile::renameFile( (m_strFolder + "_temp_journal").c_str(), (m_strFolder + "_journal").c_str());
108
122
  if (m_nError)
109
123
  {
@@ -111,6 +125,8 @@ unsigned int CFileTransaction::start()
111
125
  return m_nError;
112
126
  }
113
127
 
128
+ LOG(TRACE) + "FileTransaction has started";
129
+
114
130
  return m_nError;
115
131
  }
116
132
 
@@ -121,8 +137,11 @@ CFileTransaction::~CFileTransaction()
121
137
 
122
138
  void CFileTransaction::commit()
123
139
  {
140
+ LOG(TRACE) + "FileTransaction is committing: " + m_strFolder;
124
141
  String strFolder = m_strFolder;
125
142
 
143
+ LOG(TRACE) + "Renaming: " + strFolder + "_journal" + " -> " + strFolder + "_temp_journal";
144
+
126
145
  m_nError = CRhoFile::renameFile( (strFolder + "_journal").c_str(), (strFolder + "_temp_journal").c_str() );
127
146
  if (m_nError)
128
147
  {
@@ -131,6 +150,8 @@ void CFileTransaction::commit()
131
150
  }
132
151
  m_strFolder = "";
133
152
 
153
+ LOG(TRACE) + "Deleting: " + strFolder + "_temp_journal";
154
+
134
155
  m_nError = CRhoFile::deleteFolder( (strFolder + "_temp_journal").c_str() );
135
156
  if (m_nError)
136
157
  {
@@ -138,15 +159,18 @@ void CFileTransaction::commit()
138
159
  return;
139
160
  }
140
161
 
162
+ LOG(TRACE) + "FileTransaction has committed";
141
163
  }
142
164
 
143
165
  unsigned int CFileTransaction::rollback()
144
166
  {
167
+ LOG(TRACE) + "FileTransaction is rolling back: " + m_strFolder;
168
+
145
169
  String strFolder = m_strFolder;
146
170
  m_strFolder = "";
147
171
 
148
172
  if ( strFolder.length() == 0 )
149
- return 0;
173
+ return 0;
150
174
 
151
175
  CRhoFile::deleteFolder( CFilePath(strFolder).changeBaseName("RhoBundle").c_str() );
152
176
  CRhoFile::deleteFolder( (strFolder + "_temp_journal").c_str() );
@@ -170,11 +194,15 @@ unsigned int CFileTransaction::rollback()
170
194
  return m_nError;
171
195
  }
172
196
 
197
+ LOG(TRACE) + "FileTransaction has rolled back";
198
+
173
199
  return m_nError;
174
200
  }
175
201
 
176
202
  unsigned int CReplaceBundleThread::removeFilesByList( const String& strListPath, const String& strSrcFolder )
177
203
  {
204
+ LOG(TRACE) + "Removing files by list: " + strSrcFolder;
205
+
178
206
  unsigned int nError = 0;
179
207
  String strList;
180
208
  CRhoFile::loadTextFile(strListPath.c_str(), strList);
@@ -194,6 +222,8 @@ unsigned int CReplaceBundleThread::removeFilesByList( const String& strListPath,
194
222
 
195
223
  if ( strType.compare("file") == 0)
196
224
  {
225
+ LOG(TRACE) + "Deleting file: " + CFilePath::join( strSrcFolder,strPath);
226
+
197
227
  nError = CRhoFile::deleteFile( CFilePath::join( strSrcFolder,strPath).c_str() );
198
228
  if (nError != 0)
199
229
  {
@@ -208,7 +238,9 @@ unsigned int CReplaceBundleThread::removeFilesByList( const String& strListPath,
208
238
 
209
239
  unsigned int CReplaceBundleThread::moveFilesByList( const String& strListPath, const String& strSrcFolder, const String& strDestFolder )
210
240
  {
211
- unsigned int nError = 0;
241
+ LOG(TRACE) + "Moving files by list: " + strSrcFolder + " -> " + strDestFolder;
242
+
243
+ unsigned int nError = 0;
212
244
  String strList;
213
245
  CRhoFile::loadTextFile(strListPath.c_str(), strList);
214
246
 
@@ -229,9 +261,11 @@ unsigned int CReplaceBundleThread::moveFilesByList( const String& strListPath, c
229
261
 
230
262
  if ( strType.compare("dir") == 0)
231
263
  {
264
+ LOG(TRACE) + "Creating folder: " + strDstPath;
232
265
  CRhoFile::createFolder(strDstPath.c_str());
233
266
  }else if ( strType.compare("file") == 0)
234
267
  {
268
+ LOG(TRACE) + "Renaming file: " + strSrcPath + " -> " + strDstPath;
235
269
  nError = CRhoFile::renameFile( strSrcPath.c_str(), strDstPath.c_str() );
236
270
  if (nError != 0)
237
271
  {
@@ -295,6 +329,12 @@ void CReplaceBundleThread::doReplaceBundle()
295
329
  LOG(INFO) + "STOP";
296
330
  oFT.commit();
297
331
 
332
+ #ifdef OS_ANDROID
333
+ //rho_file_patch_stat_table(CFilePath::join(m_bundle_path, "RhoBundle/apps/rhofilelist.txt"))
334
+ CRhoFile::copyFile(CFilePath::join(m_bundle_path, "RhoBundle/rho.dat").c_str(), RHODESAPP().getRhoRootPath().c_str());
335
+ #endif
336
+
337
+
298
338
  //Delete bundle folder
299
339
  CRhoFile::deleteFolder( m_bundle_path.c_str());
300
340
  }