rhodes 2.0.0.beta7 → 2.0.0.beta8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/CHANGELOG +20 -1
  2. data/bin/rhodes-setup +6 -2
  3. data/lib/extensions/digest/ext/Rakefile +2 -2
  4. data/lib/framework/rho/render.rb +2 -0
  5. data/lib/framework/rho/rho.rb +159 -95
  6. data/lib/framework/rho/rhoapplication.rb +24 -5
  7. data/lib/framework/rhodes.rb +1 -1
  8. data/lib/framework/rhom/rhom_model.rb +32 -23
  9. data/lib/framework/rhom/rhom_object_factory.rb +2 -2
  10. data/lib/rhodes.rb +1 -1
  11. data/platform/android/Rhodes/jni/src/callbacks.cpp +8 -1
  12. data/platform/android/Rhodes/jni/src/mapview.cpp +4 -1
  13. data/platform/android/Rhodes/jni/src/sslimpl.cpp +5 -1
  14. data/platform/android/Rhodes/jni/src/webview.cpp +3 -1
  15. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +3 -2
  16. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +2 -2
  17. data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +1 -2
  18. data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +1 -1
  19. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +3 -1
  20. data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +0 -1
  21. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +4 -1
  22. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +24 -6
  23. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +7 -2
  24. data/platform/android/build/android.rake +11 -38
  25. data/platform/android/build/androidcommon.rb +50 -2
  26. data/platform/android/build/librhocommon_build.files +1 -0
  27. data/platform/android/build/libsqlite_build.files +1 -0
  28. data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +2 -1
  29. data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -5
  30. data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +3 -6
  31. data/platform/bb/rhodes/src/com/rho/rubyext/System.java +4 -2
  32. data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +12 -35
  33. data/platform/bb/rhodes/src/rhomobile/Utilities.java +2 -1
  34. data/platform/iphone/Classes/DateTimePickerDelegate.m +4 -4
  35. data/platform/iphone/Classes/NativeBar.m +12 -6
  36. data/platform/iphone/Classes/NavBar.m +1 -1
  37. data/platform/iphone/Classes/RhoMainView.h +4 -1
  38. data/platform/iphone/Classes/Rhodes.h +6 -2
  39. data/platform/iphone/Classes/Rhodes.m +23 -3
  40. data/platform/iphone/Classes/SimpleMainView.h +3 -7
  41. data/platform/iphone/Classes/SimpleMainView.m +108 -54
  42. data/platform/iphone/Classes/TabbedMainView.h +3 -2
  43. data/platform/iphone/Classes/TabbedMainView.m +21 -10
  44. data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
  45. data/platform/shared/common/IRhoClassFactory.h +1 -0
  46. data/platform/shared/common/RhodesApp.cpp +7 -2
  47. data/platform/shared/common/ThreadQueue.cpp +110 -0
  48. data/platform/shared/common/ThreadQueue.h +75 -0
  49. data/platform/shared/logging/RhoLogCat.h +4 -0
  50. data/platform/shared/net/AsyncHttp.cpp +134 -135
  51. data/platform/shared/net/AsyncHttp.h +74 -33
  52. data/platform/shared/net/HttpServer.cpp +7 -1
  53. data/platform/shared/ruby/thread.c +4 -0
  54. data/platform/shared/ruby/thread_win32.c +9 -8
  55. data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +26 -5
  56. data/platform/shared/rubyJVM/src/com/rho/net/INetworkAccess.java +0 -2
  57. data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +4 -13
  58. data/platform/shared/rubyJVM/src/com/rho/net/URI.java +2 -2
  59. data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +3 -3
  60. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/ObjectFactory.java +12 -2
  61. data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +6 -3
  62. data/platform/shared/rubyJVM/src/javolution/util/FastTable.java +12 -2
  63. data/platform/shared/sync/SyncEngine.cpp +15 -3
  64. data/platform/shared/sync/SyncEngine.h +1 -1
  65. data/platform/shared/sync/SyncThread.cpp +18 -101
  66. data/platform/shared/sync/SyncThread.h +30 -22
  67. data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
  68. data/platform/wm/rhodes/Rhodes.cpp +143 -1
  69. data/platform/wm/rhodes/memory_helper.cpp +273 -0
  70. data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +1 -0
  71. data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +46 -3
  72. data/platform/wm/rhodes/rho/rubyext/WebView.cpp +29 -1
  73. data/res/build-tools/db/syncdb.schema +1 -0
  74. data/res/generators/rhogen.rb +1 -1
  75. data/rhodes.gemspec +2 -2
  76. metadata +23 -6
  77. data/Manifest.txt +0 -5289
  78. data/rhobuild.yml +0 -37
@@ -25,7 +25,7 @@
25
25
  NSString *title = [args objectAtIndex:0];
26
26
  NSArray *left = [args objectAtIndex:1];
27
27
  NSArray *right = [args objectAtIndex:2];
28
- [[[Rhodes sharedInstance] mainView] setNavBar:title left:left right:right];
28
+ [[[Rhodes sharedInstance] mainView] addNavBar:title left:left right:right];
29
29
  }
30
30
  @end
31
31
 
@@ -11,6 +11,9 @@
11
11
  @protocol RhoMainView
12
12
 
13
13
  - (UIView*)view;
14
+ - (UIView*)parent;
15
+
16
+ - (UIWebView*)detachWebView;
14
17
 
15
18
  - (void)loadHTMLString:(NSString*)data;
16
19
 
@@ -27,7 +30,7 @@
27
30
  - (void)switchTab:(int)index;
28
31
  - (int)activeTab;
29
32
 
30
- - (void)setNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right;
33
+ - (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right;
31
34
  - (void)removeNavBar;
32
35
 
33
36
  @end
@@ -32,13 +32,12 @@
32
32
  LogViewController* logViewController;
33
33
  DateTimePickerDelegate* dateTimePickerDelegate;
34
34
  PickImageDelegate* pickImageDelegate;
35
- @public
35
+
36
36
  id<RhoMainView,NSObject> mainView;
37
37
  }
38
38
 
39
39
  @property (nonatomic, retain) UIWindow *window;
40
40
  @property (nonatomic, retain) AVAudioPlayer *player;
41
- @property (nonatomic, retain) id<RhoMainView,NSObject> mainView;
42
41
  @property (nonatomic, retain) NSMutableDictionary *cookies;
43
42
 
44
43
  + (Rhodes*)sharedInstance;
@@ -48,6 +47,8 @@
48
47
  + (CGRect)applicationFrame;
49
48
  + (void)setStatusBarHidden:(BOOL)v;
50
49
 
50
+ //+ (UIView*)subviewWithTag:(NSInteger)tag ofView:(UIView*)view;
51
+
51
52
  + (void)performOnUiThread:(id)runnable wait:(BOOL)wait;
52
53
  + (void)performOnUiThread:(id)runnable arg:(id)arg wait:(BOOL)wait;
53
54
  + (void)performOnUiThread:(id)runnable arg:(id)arg1 arg:(id)arg2 wait:(BOOL)wait;
@@ -60,4 +61,7 @@
60
61
  - (void)setCookie:(NSString*)cookie forUrl:(NSString*)url;
61
62
  - (NSString*)cookie:(NSString*)url;
62
63
 
64
+ - (id<RhoMainView,NSObject>)mainView;
65
+ - (void)setMainView:(id<RhoMainView,NSObject>)view;
66
+
63
67
  @end
@@ -17,7 +17,7 @@ void rho_geoimpl_init();
17
17
 
18
18
  @implementation Rhodes
19
19
 
20
- @synthesize window, player, mainView, cookies;
20
+ @synthesize window, player, cookies;
21
21
 
22
22
  static Rhodes *instance = NULL;
23
23
 
@@ -46,6 +46,24 @@ static Rhodes *instance = NULL;
46
46
  [[[[Rhodes sharedInstance] mainView] view] setFrame:[Rhodes applicationFrame]];
47
47
  }
48
48
 
49
+ #if 0
50
+ + (UIView*)subviewWithTag:(NSInteger)tag ofView:(UIView*)view {
51
+ if (!view)
52
+ return nil;
53
+
54
+ for (int i = 0, lim = [view.subviews count]; i < lim; ++i) {
55
+ UIView *subview = [view.subviews objectAtIndex:i];
56
+ if (subview.tag == tag)
57
+ return subview;
58
+ subview = [self subviewWithTag:tag ofView:subview];
59
+ if (subview)
60
+ return subview;
61
+ }
62
+
63
+ return nil;
64
+ }
65
+ #endif
66
+
49
67
  - (void)runRunnable:(NSArray*)args {
50
68
  id runnable = [args objectAtIndex:0];
51
69
  if ([runnable respondsToSelector:@selector(run)])
@@ -231,12 +249,15 @@ static Rhodes *instance = NULL;
231
249
  splashViewController = nil;
232
250
  }
233
251
 
234
- [mainView.view removeFromSuperview];
235
252
  [mainView release];
236
253
  mainView = [view retain];
237
254
  [window addSubview:mainView.view];
238
255
  }
239
256
 
257
+ - (id<RhoMainView,NSObject>)mainView {
258
+ return mainView;
259
+ }
260
+
240
261
  - (void) showLoadingPage
241
262
  {
242
263
  NSFileManager *fileManager = [NSFileManager defaultManager];
@@ -288,7 +309,6 @@ static Rhodes *instance = NULL;
288
309
  dateTimePickerDelegate = [[DateTimePickerDelegate alloc] init];
289
310
  pickImageDelegate = [[PickImageDelegate alloc] init];
290
311
 
291
- rho_geoimpl_init();
292
312
  rho_rhodesapp_start();
293
313
 
294
314
  #ifdef __IPHONE_3_0
@@ -18,13 +18,9 @@
18
18
  }
19
19
 
20
20
  @property (retain) UIView *root;
21
- @property (retain) UIWebView *webView;
22
- @property (retain) UIToolbar *toolbar;
23
- @property (retain) UINavigationBar *navbar;
24
21
 
25
- - (id)initWithParentView:(UIView *)v;
26
- - (id)initWithParentView:(UIView *)v frame:(CGRect)frame;
27
- - (id)initWithParentView:(UIView *)v toolbar:(NSArray*)items;
28
- - (id)initWithParentView:(UIView *)v frame:(CGRect)frame toolbar:(NSArray*)items;
22
+ - (id)initWithMainView:(id<RhoMainView>)v;
23
+ - (id)initWithMainView:(id<RhoMainView>)v toolbar:(NSArray*)items;
24
+ - (id)initWithParentView:(UIView *)p frame:(CGRect)frame;
29
25
 
30
26
  @end
@@ -1,4 +1,4 @@
1
- //
1
+ //
2
2
  // SimpleMainView.m
3
3
  // rhorunner
4
4
  //
@@ -17,6 +17,10 @@
17
17
  #undef DEFAULT_LOGCATEGORY
18
18
  #define DEFAULT_LOGCATEGORY "SimpleMainView"
19
19
 
20
+ #define RHO_TAG_WEBVIEW 1
21
+ #define RHO_TAG_TOOLBAR 2
22
+ #define RHO_TAG_NAVBAR 3
23
+
20
24
  @interface RhoToolbarButtonItemAction : NSObject
21
25
  {
22
26
  NSString *url;
@@ -53,7 +57,7 @@
53
57
 
54
58
  @implementation SimpleMainView
55
59
 
56
- @synthesize root, webView, toolbar, navbar;
60
+ @synthesize root;
57
61
 
58
62
  - (UIBarButtonItem*)newButton:(NSString*)url label:(NSString*)label icon:(NSString*)icon {
59
63
  UIImage *img = nil;
@@ -176,50 +180,66 @@
176
180
  return tb;
177
181
  }
178
182
 
179
- - (id)initWithParentView:(UIView *)v {
180
- return [self initWithParentView:v toolbar:nil];
183
+ - (void)removeToolbar {
184
+ if (toolbar) {
185
+ CGRect wFrame = webView.frame;
186
+ CGRect tbFrame = toolbar.frame;
187
+ wFrame.size.height += tbFrame.size.height;
188
+ webView.frame = wFrame;
189
+ }
190
+
191
+ [toolbar removeFromSuperview];
192
+ toolbar = nil;
181
193
  }
182
194
 
183
- - (id)initWithParentView:(UIView *)v frame:(CGRect)frame {
184
- return [self initWithParentView:v frame:frame toolbar:nil];
195
+ - (void)addToolbar:(NSArray*)items {
196
+ [self removeToolbar];
197
+
198
+ if (!items)
199
+ return;
200
+
201
+ CGRect wFrame = webView.frame;
202
+
203
+ [toolbar removeFromSuperview];
204
+ toolbar = [self newToolbar:items frame:wFrame];
205
+ toolbar.tag = RHO_TAG_TOOLBAR;
206
+ [root addSubview:toolbar];
207
+
208
+ CGRect tbFrame = toolbar.frame;
209
+ wFrame.size.height -= tbFrame.size.height;
210
+ webView.frame = wFrame;
185
211
  }
186
212
 
187
- - (id)initWithParentView:(UIView *)v toolbar:(NSArray*)items {
188
- return [self initWithParentView:v frame:v.frame toolbar:items];
213
+ - (UIWebView*)newWebView:(CGRect)frame {
214
+ UIWebView *w = [[UIWebView alloc] initWithFrame:frame];
215
+ w.scalesPageToFit = YES;
216
+ w.userInteractionEnabled = YES;
217
+ w.multipleTouchEnabled = YES;
218
+ w.autoresizesSubviews = YES;
219
+ w.clipsToBounds = NO;
220
+ w.dataDetectorTypes = UIDataDetectorTypeNone;
221
+ w.delegate = self;
222
+ w.tag = RHO_TAG_WEBVIEW;
223
+
224
+ return w;
189
225
  }
190
226
 
191
- - (id)initWithParentView:(UIView *)v frame:(CGRect)frame toolbar:(NSArray*)items {
192
- parent = v;
227
+ - (id)init:(UIView*)p webView:(UIWebView*)w frame:(CGRect)frame toolbar:(NSArray*)items {
228
+ parent = p;
193
229
 
194
230
  root = [[UIView alloc] initWithFrame:frame];
195
231
  root.userInteractionEnabled = YES;
196
232
 
233
+ [webView removeFromSuperview];
234
+ webView = w;
235
+ if (!webView)
236
+ webView = [self newWebView:frame];
237
+ [root addSubview:webView];
197
238
  CGRect wFrame = frame;
198
239
  wFrame.origin.y = 0;
199
- webView = [[UIWebView alloc] initWithFrame:wFrame];
200
- webView.scalesPageToFit = YES;
201
- webView.userInteractionEnabled = YES;
202
- //webView.detectsPhoneNumbers = YES;
203
- webView.multipleTouchEnabled = YES;
204
- webView.autoresizesSubviews = YES;
205
- webView.clipsToBounds = NO;
206
- webView.delegate = self;
207
-
208
- [root addSubview:webView];
209
-
210
- if (items) {
211
- UIToolbar *tb = [self newToolbar:items frame:wFrame];
212
- self.toolbar = tb;
213
- [root addSubview:toolbar];
214
-
215
- CGRect newFrame = wFrame;
216
- CGRect tbFrame = tb.frame;
217
- newFrame.size.height -= tbFrame.size.height;
218
- webView.frame = newFrame;
219
-
220
- [tb release];
221
- }
240
+ webView.frame = wFrame;
222
241
 
242
+ [self addToolbar:items];
223
243
  navbar = nil;
224
244
 
225
245
  self.view = root;
@@ -227,6 +247,26 @@
227
247
  return self;
228
248
  }
229
249
 
250
+ - (id)initWithParentView:(UIView *)p frame:(CGRect)frame toolbar:(NSArray*)items {
251
+ return [self init:p webView:nil frame:frame toolbar:items];
252
+ }
253
+
254
+ - (id)initWithParentView:(UIView *)p frame:(CGRect)frame {
255
+ return [self initWithParentView:p frame:frame toolbar:nil];
256
+ }
257
+
258
+ - (id)initWithMainView:(id<RhoMainView>)v {
259
+ return [self initWithMainView:v toolbar:nil];
260
+ }
261
+
262
+ - (id)initWithMainView:(id<RhoMainView>)v toolbar:(NSArray*)items {
263
+ UIView *p = [v parent];
264
+ CGRect frame = [[v view] frame];
265
+ //UIWebView *w = (UIWebView*)[Rhodes subviewWithTag:RHO_TAG_WEBVIEW ofView:[v view]];
266
+ UIWebView *w = [v detachWebView];
267
+ return [self init:p webView:w frame:frame toolbar:items];
268
+ }
269
+
230
270
  - (void)didReceiveMemoryWarning {
231
271
  // Releases the view if it doesn't have a superview.
232
272
  [super didReceiveMemoryWarning];
@@ -236,13 +276,10 @@
236
276
 
237
277
  - (void)viewDidUnload {
238
278
  [super viewDidUnload];
239
- [root removeFromSuperview];
240
279
  }
241
280
 
242
281
  - (void)dealloc {
243
- [navbar release];
244
- [toolbar release];
245
- [webView release];
282
+ [root removeFromSuperview];
246
283
  [root release];
247
284
  [super dealloc];
248
285
  }
@@ -277,6 +314,18 @@
277
314
  return root;
278
315
  }
279
316
 
317
+ - (UIView*)parent {
318
+ return parent;
319
+ }
320
+
321
+ - (UIWebView*)detachWebView {
322
+ UIWebView *w = [webView retain];
323
+ [w removeFromSuperview];
324
+ webView = nil;
325
+
326
+ return w;
327
+ }
328
+
280
329
  - (void)loadHTMLString:(NSString *)data {
281
330
  [webView loadHTMLString:data baseURL:[NSURL URLWithString:@""]];
282
331
  }
@@ -290,17 +339,14 @@
290
339
  }
291
340
 
292
341
  - (void)navigate:(NSString *)url tab:(int)index {
293
- NSString *escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
294
- NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:escapedUrl]];
342
+ NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
295
343
  [webView loadRequest:request];
296
344
  }
297
345
 
298
346
  - (void)navigateRedirect:(NSString *)url tab:(int)index {
299
- NSString* escapedUrl = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
300
- NSString* redirector = [@"/system/redirect_to?url=" stringByAppendingString:escapedUrl];
301
347
  NSString* homeurl = [NSString stringWithUTF8String:rho_rhodesapp_gethomeurl()];
302
- NSString* redirector1 = [homeurl stringByAppendingString:redirector];
303
- [self navigate:redirector1 tab:index];
348
+ NSString *redirect = [NSString stringWithFormat:@"%@/system/redirect_to?url=%@", homeurl, url];
349
+ [self navigate:redirect tab:index];
304
350
  }
305
351
 
306
352
  - (void)reload:(int)index {
@@ -326,10 +372,11 @@
326
372
  return 0;
327
373
  }
328
374
 
329
- - (void)setNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
375
+ - (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
330
376
  [self removeNavBar];
331
377
 
332
378
  UINavigationBar *nb = [[UINavigationBar alloc] initWithFrame:CGRectZero];
379
+ nb.tag = RHO_TAG_NAVBAR;
333
380
  [nb sizeToFit];
334
381
 
335
382
  UINavigationItem *ni = [[UINavigationItem alloc] initWithTitle:title];
@@ -352,9 +399,8 @@
352
399
  }
353
400
 
354
401
  [nb pushNavigationItem:ni animated:NO];
355
- self.navbar = nb;
356
- [nb release];
357
-
402
+ [navbar removeFromSuperview];
403
+ navbar = nb;
358
404
  [root addSubview:navbar];
359
405
 
360
406
  CGRect nFrame = navbar.frame;
@@ -374,7 +420,7 @@
374
420
  }
375
421
 
376
422
  [navbar removeFromSuperview];
377
- self.navbar = nil;
423
+ navbar = nil;
378
424
  }
379
425
 
380
426
  // UIWebViewDelegate imlementation
@@ -382,12 +428,20 @@
382
428
  - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
383
429
  navigationType:(UIWebViewNavigationType)navigationType {
384
430
  NSString *url = [[request URL] absoluteString];
385
- if (url) {
386
- NSString *c = [[Rhodes sharedInstance] cookie:url];
387
- if (c) {
388
- NSMutableURLRequest *r = (NSMutableURLRequest*)request;
389
- [r addValue:c forHTTPHeaderField:@"Cookie"];
390
- }
431
+ if (!url)
432
+ return NO;
433
+
434
+ if (![url hasPrefix:@"http:"]) {
435
+ // This is not http url so try to open external application for it
436
+ [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
437
+ return NO;
438
+ }
439
+
440
+ // Retrieve cookie for http url
441
+ NSString *c = [[Rhodes sharedInstance] cookie:url];
442
+ if (c && [request isKindOfClass:[NSMutableURLRequest class]]) {
443
+ NSMutableURLRequest *r = (NSMutableURLRequest*)request;
444
+ [r addValue:c forHTTPHeaderField:@"Cookie"];
391
445
  }
392
446
  return YES;
393
447
  }
@@ -18,7 +18,8 @@
18
18
  @property (nonatomic,retain) UITabBarController *tabbar;
19
19
  @property (nonatomic,retain) NSArray *tabbarData;
20
20
 
21
- - (id)initWithParentView:(UIView*)v items:(NSArray*)items;
22
- - (id)initWithParentView:(UIView*)v frame:(CGRect)frame items:(NSArray*)items;
21
+ //- (id)initWithParentView:(UIView*)v items:(NSArray*)items;
22
+ //- (id)initWithParentView:(UIView*)v frame:(CGRect)frame items:(NSArray*)items;
23
+ - (id)initWithMainView:(id<RhoMainView>)v tabs:(NSArray*)items;
23
24
 
24
25
  @end
@@ -54,12 +54,15 @@
54
54
 
55
55
  @synthesize tabbar, tabbarData;
56
56
 
57
- - (id)initWithParentView:(UIView *)v items:(NSArray *)items {
58
- return [self initWithParentView:v frame:v.frame items:items];
59
- }
57
+ //- (id)initWithParentView:(UIView *)v items:(NSArray *)items {
58
+ // return [self initWithParentView:v frame:v.frame items:items];
59
+ //}
60
60
 
61
- - (id)initWithParentView:(UIView *)v frame:(CGRect)frame items:(NSArray*)items {
62
- parent = v;
61
+ //- (id)initWithParentView:(UIView *)v frame:(CGRect)frame items:(NSArray*)items {
62
+ - (id)initWithMainView:(id<RhoMainView>)v tabs:(NSArray *)items {
63
+ parent = [v parent];
64
+
65
+ CGRect frame = [[v view] frame];
63
66
 
64
67
  tabbar = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
65
68
  tabbar.delegate = [Rhodes sharedInstance];
@@ -90,7 +93,7 @@
90
93
  subController.title = label;
91
94
  NSString *imagePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:icon];
92
95
  subController.tabBarItem.image = [UIImage imageWithContentsOfFile:imagePath];
93
- [subController navigate:url tab:0];
96
+ [subController navigateRedirect:url tab:0];
94
97
 
95
98
  [tabs addObject:td];
96
99
  [views addObject:subController];
@@ -118,11 +121,11 @@
118
121
 
119
122
  - (void)viewDidUnload {
120
123
  [super viewDidUnload];
121
- self.tabbar = nil;
122
124
  }
123
125
 
124
126
  - (void)dealloc {
125
- [tabbar release];
127
+ [tabbar.view removeFromSuperview];
128
+ [tabbarData release];
126
129
  [super dealloc];
127
130
  }
128
131
 
@@ -140,6 +143,14 @@
140
143
  return tabbar.view;
141
144
  }
142
145
 
146
+ - (UIView*)parent {
147
+ return parent;
148
+ }
149
+
150
+ - (UIWebView*)detachWebView {
151
+ return [[self subView:[self activeTab]] detachWebView];
152
+ }
153
+
143
154
  - (void)loadHTMLString:(NSString *)data {
144
155
  [[self subView:[self activeTab]] loadHTMLString:data];
145
156
  }
@@ -190,8 +201,8 @@
190
201
  return tabbar.selectedIndex;
191
202
  }
192
203
 
193
- - (void)setNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
194
- [[self subView:[self activeTab]] setNavBar:title left:left right:right];
204
+ - (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
205
+ [[self subView:[self activeTab]] addNavBar:title left:left right:right];
195
206
  }
196
207
 
197
208
  - (void)removeNavBar {