rhodes 2.0.0.beta1 → 2.0.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/LICENSE +19 -674
- data/Manifest.txt +21 -4
- data/README.textile +5 -36
- data/Rakefile +5 -0
- data/lib/build/jake.rb +3 -1
- data/lib/extensions/rexml/rexml/document.rb +2 -0
- data/lib/extensions/rexml/rexml/parsers/baseparser.rb +0 -6
- data/lib/extensions/rhoxml/rexml/child.rb +96 -0
- data/lib/extensions/rhoxml/rexml/document.rb +527 -0
- data/lib/extensions/rhoxml/rexml/element.rb +987 -0
- data/lib/extensions/rhoxml/rexml/encoding.rb +71 -0
- data/lib/extensions/rhoxml/rexml/encodings/US-ASCII.rb +30 -0
- data/lib/extensions/rhoxml/rexml/encodings/UTF-16.rb +35 -0
- data/lib/extensions/rhoxml/rexml/encodings/UTF-8.rb +18 -0
- data/lib/extensions/rhoxml/rexml/namespace.rb +47 -0
- data/lib/extensions/rhoxml/rexml/node.rb +76 -0
- data/lib/extensions/rhoxml/rexml/parent.rb +166 -0
- data/lib/extensions/rhoxml/rexml/parseexception.rb +51 -0
- data/lib/extensions/rhoxml/rexml/parsers/baseparser.rb +531 -0
- data/lib/extensions/rhoxml/rexml/parsers/treeparser.rb +100 -0
- data/lib/extensions/rhoxml/rexml/parsers/xpathparser.rb +698 -0
- data/lib/extensions/rhoxml/rexml/set.rb +1274 -0
- data/lib/extensions/rhoxml/rexml/source.rb +258 -0
- data/lib/extensions/rhoxml/rexml/xmltokens.rb +18 -0
- data/lib/extensions/rhoxml/rexml/xpath.rb +77 -0
- data/lib/extensions/rhoxml/rexml/xpath_parser.rb +806 -0
- data/lib/framework/builtinME.rb +2 -0
- data/lib/framework/dateME.rb +5 -1
- data/lib/framework/rho/render.rb +10 -2
- data/lib/framework/rhom/rhom_object_factory.rb +2 -1
- data/lib/framework/singleton.rb +1 -1
- data/platform/android/Rhodes/jni/src/rhodes.cpp +2 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +23 -18
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +42 -69
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +59 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Annotation.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +97 -85
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/SmsUriHandler.java +52 -0
- data/platform/android/build/RhodesSRC_build.files +1 -0
- data/platform/android/build/android.rake +38 -14
- data/platform/bb/RubyVM/RubyVM.jdp +1 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +44 -2
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +1 -1
- data/platform/bb/rhodes/rhodes.jdp +4 -4
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +8 -4
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +149 -17
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +20 -17
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +54 -28
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +1 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +37 -11
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +49 -19
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +6 -0
- data/platform/iphone/Classes/MapView/GoogleGeocoder.h +6 -7
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +70 -70
- data/platform/iphone/Classes/MapView/MapAnnotation.h +5 -3
- data/platform/iphone/Classes/MapView/MapAnnotation.m +10 -8
- data/platform/iphone/Classes/MapView/MapViewController.h +13 -10
- data/platform/iphone/Classes/MapView/MapViewController.m +131 -72
- data/platform/iphone/Classes/Rhodes.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +13 -1
- data/platform/iphone/Classes/SimpleMainView.m +0 -1
- data/platform/iphone/Classes/TabbedMainView.m +5 -6
- data/platform/shared/common/RhoTime.h +2 -2
- data/platform/shared/common/RhodesApp.cpp +1 -1
- data/platform/shared/db/DBAdapter.cpp +6 -0
- data/platform/shared/net/CURLNetRequest.cpp +23 -1
- data/platform/shared/ruby/thread_win32.c +9 -1
- data/platform/shared/rubyJVM/src/com/rho/Capabilities.java +6 -0
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +1 -1
- data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +1 -1
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +6 -1
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubyTime_Methods.java +3 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/InputStreamExecutor.java +1 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyArray.java +15 -3
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyString.java +10 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyTime.java +12 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyKernelModule.java +18 -9
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +5 -0
- data/platform/shared/rubyJVM/src/org/json/me/JSONArray.java +2 -1
- data/platform/shared/unzip/unzip.cpp +1 -1
- data/platform/wm/build/wm.rake +27 -6
- data/platform/wm/rhodes/Alert.cpp +335 -5
- data/platform/wm/rhodes/Alert.h +84 -1
- data/platform/wm/rhodes/MainWindow.cpp +28 -6
- data/platform/wm/rhodes/MainWindow.h +7 -2
- data/platform/wm/rhodes/Rhodes.cpp +23 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +2 -1
- data/platform/wm/rhodes/stdafx.h +1 -0
- data/platform/wm/tools/detool/detool.cpp +405 -14
- data/rakefile.rb +5 -0
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +2 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/spec/fixtures/object_values.txt +1 -1
- data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +1 -1
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +12 -12
- metadata +23 -6
- data/LICENSING_OPTIONS +0 -1
- data/platform/bb/build/rhodesApp.rapc +0 -9
- data/res/generators/templates/source/source_adapter.rb +0 -48
- data/rhobuild.yml +0 -37
@@ -14,22 +14,25 @@
|
|
14
14
|
#import "common/rhoparams.h"
|
15
15
|
|
16
16
|
@interface MapViewController : UIViewController <MKReverseGeocoderDelegate,MKMapViewDelegate> {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
MKMapView *mapView;
|
18
|
+
MKReverseGeocoder *geoCoder;
|
19
|
+
GoogleGeocoder* ggeoCoder;
|
20
|
+
UIToolbar* toolbar;
|
21
|
+
MKMapType mapType;
|
22
22
|
BOOL zoomEnabled;
|
23
23
|
BOOL scrollEnabled;
|
24
24
|
BOOL showsUserLocation;
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
BOOL region_set;
|
26
|
+
MKCoordinateRegion region;
|
27
|
+
NSString *region_center;
|
28
|
+
CLLocationDegrees region_radius;
|
29
|
+
NSString *gapikey;
|
30
|
+
//IBOutlet UISegmentedControl *mapType;
|
29
31
|
}
|
30
32
|
|
31
33
|
//
|
32
|
-
@property (copy) NSString*
|
34
|
+
@property (copy) NSString *region_center;
|
35
|
+
@property (copy) NSString *gapikey;
|
33
36
|
|
34
37
|
+ (void)createMap:(rho_param*)params;
|
35
38
|
- (void)setParams:(rho_param*)params;
|
@@ -32,7 +32,7 @@
|
|
32
32
|
|
33
33
|
@implementation MapViewController
|
34
34
|
|
35
|
-
@synthesize gapikey;
|
35
|
+
@synthesize region_center, gapikey;
|
36
36
|
|
37
37
|
+ (void)createMap:(rho_param *)params {
|
38
38
|
id runnable = [RhoCreateMapTask class];
|
@@ -42,11 +42,12 @@
|
|
42
42
|
|
43
43
|
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
44
44
|
if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
mapType = MKMapTypeStandard;
|
46
|
+
zoomEnabled = TRUE;
|
47
|
+
scrollEnabled = TRUE;
|
48
|
+
showsUserLocation = TRUE;
|
49
|
+
region_set = FALSE;
|
50
|
+
region_center = nil;
|
50
51
|
}
|
51
52
|
return self;
|
52
53
|
}
|
@@ -71,27 +72,60 @@
|
|
71
72
|
mapType = MKMapTypeSatellite;
|
72
73
|
else if (strcasecmp(map_type, "hybrid") == 0)
|
73
74
|
mapType = MKMapTypeHybrid;
|
75
|
+
else {
|
76
|
+
RAWLOG_ERROR1("Unknown map type: %s", map_type);
|
77
|
+
continue;
|
78
|
+
}
|
74
79
|
}
|
75
80
|
else if (strcasecmp(name, "region") == 0) {
|
76
|
-
if (value->type
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
81
|
+
if (value->type == RHO_PARAM_ARRAY) {
|
82
|
+
if (value->v.array->size != 4)
|
83
|
+
continue;
|
84
|
+
|
85
|
+
rho_param *lat = value->v.array->value[0];
|
86
|
+
rho_param *lon = value->v.array->value[1];
|
87
|
+
rho_param *latSpan = value->v.array->value[2];
|
88
|
+
rho_param *lonSpan = value->v.array->value[3];
|
89
|
+
|
90
|
+
CLLocationCoordinate2D location;
|
91
|
+
location.latitude = lat->type == RHO_PARAM_STRING ? strtod(lat->v.string, NULL) : 0;
|
92
|
+
location.longitude = lon->type == RHO_PARAM_STRING ? strtod(lon->v.string, NULL) : 0;
|
93
|
+
MKCoordinateSpan span;
|
94
|
+
span.latitudeDelta = latSpan->type == RHO_PARAM_STRING ? strtod(latSpan->v.string, NULL) : 0;
|
95
|
+
span.longitudeDelta = lonSpan->type == RHO_PARAM_STRING ? strtod(lonSpan->v.string, NULL) : 0;
|
96
|
+
region.span = span;
|
97
|
+
region.center = location;
|
98
|
+
region_set = TRUE;
|
99
|
+
}
|
100
|
+
else if (value->type == RHO_PARAM_HASH) {
|
101
|
+
char *center = NULL;
|
102
|
+
char *radius = NULL;
|
103
|
+
|
104
|
+
for (int j = 0, limm = value->v.hash->size; j < limm; ++j) {
|
105
|
+
char *rname = value->v.hash->name[j];
|
106
|
+
rho_param *rvalue = value->v.hash->value[j];
|
107
|
+
if (strcasecmp(rname, "center") == 0) {
|
108
|
+
if (rvalue->type != RHO_PARAM_STRING) {
|
109
|
+
RAWLOG_ERROR("Wrong type of 'center', should be String");
|
110
|
+
continue;
|
111
|
+
}
|
112
|
+
center = rvalue->v.string;
|
113
|
+
}
|
114
|
+
else if (strcasecmp(rname, "radius") == 0) {
|
115
|
+
if (rvalue->type != RHO_PARAM_STRING) {
|
116
|
+
RAWLOG_ERROR("Wrong type of 'radius', should be String");
|
117
|
+
continue;
|
118
|
+
}
|
119
|
+
radius = rvalue->v.string;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
if (!center || !radius)
|
124
|
+
continue;
|
125
|
+
|
126
|
+
region_center = [NSString stringWithUTF8String:center];
|
127
|
+
region_radius = strtod(radius, NULL);
|
128
|
+
}
|
95
129
|
}
|
96
130
|
else if (strcasecmp(name, "zoom_enabled") == 0) {
|
97
131
|
if (value->type != RHO_PARAM_STRING)
|
@@ -117,10 +151,20 @@
|
|
117
151
|
}
|
118
152
|
|
119
153
|
- (void)setAnnotations:(rho_param*)p {
|
120
|
-
int size =
|
154
|
+
int size = 1;
|
121
155
|
if (p && p->type == RHO_PARAM_ARRAY)
|
122
|
-
size
|
156
|
+
size += p->v.array->size;
|
123
157
|
NSMutableArray *annotations = [NSMutableArray arrayWithCapacity:size];
|
158
|
+
if (region_center) {
|
159
|
+
MapAnnotation *annObj = [[MapAnnotation alloc] init];
|
160
|
+
annObj.type = @"center";
|
161
|
+
annObj.address = region_center;
|
162
|
+
CLLocationCoordinate2D c;
|
163
|
+
c.latitude = c.longitude = 10000;
|
164
|
+
annObj.coordinate = c;
|
165
|
+
[annotations addObject:annObj];
|
166
|
+
[annObj release];
|
167
|
+
}
|
124
168
|
if (p && p->type == RHO_PARAM_ARRAY) {
|
125
169
|
for (int i = 0, lim = p->v.array->size; i < lim; ++i) {
|
126
170
|
rho_param *ann = p->v.array->value[i];
|
@@ -176,70 +220,73 @@
|
|
176
220
|
}
|
177
221
|
}
|
178
222
|
ggeoCoder = [[GoogleGeocoder alloc] initWithAnnotations:annotations apikey:gapikey];
|
179
|
-
|
180
|
-
|
223
|
+
ggeoCoder.actionTarget = self;
|
224
|
+
ggeoCoder.onDidFindAddress = @selector(didFindAddress:);
|
181
225
|
}
|
182
226
|
|
183
227
|
- (void)setParams:(rho_param*)p {
|
184
228
|
if (p && p->type == RHO_PARAM_HASH) {
|
229
|
+
rho_param *st = NULL;
|
230
|
+
rho_param *ann = NULL;
|
185
231
|
for (int i = 0, lim = p->v.hash->size; i < lim; ++i) {
|
186
232
|
char *name = p->v.hash->name[i];
|
187
233
|
rho_param *value = p->v.hash->value[i];
|
188
234
|
if (strcasecmp(name, "settings") == 0)
|
189
|
-
|
235
|
+
st = value;
|
190
236
|
else if (strcasecmp(name, "annotations") == 0)
|
191
|
-
|
237
|
+
ann = value;
|
192
238
|
}
|
239
|
+
if (st)
|
240
|
+
[self setSettings:st];
|
241
|
+
[self setAnnotations:ann];
|
193
242
|
}
|
194
243
|
rho_param_free(p);
|
195
244
|
}
|
196
245
|
|
197
246
|
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
|
198
247
|
- (void)viewDidLoad {
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
248
|
+
[super viewDidLoad];
|
249
|
+
|
250
|
+
//Initialize the toolbar
|
251
|
+
toolbar = [[UIToolbar alloc] init];
|
252
|
+
toolbar.barStyle = UIBarStyleBlack;
|
253
|
+
[toolbar sizeToFit];
|
254
|
+
CGFloat toolbarHeight = [toolbar frame].size.height;
|
255
|
+
CGRect rootViewBounds = self.view.bounds;
|
256
|
+
CGFloat rootViewHeight = CGRectGetHeight(rootViewBounds);
|
257
|
+
CGFloat rootViewWidth = CGRectGetWidth(rootViewBounds);
|
258
|
+
CGRect rectArea = CGRectMake(0, rootViewHeight - toolbarHeight, rootViewWidth, toolbarHeight);
|
259
|
+
[toolbar setFrame:rectArea];
|
260
|
+
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc]
|
261
|
+
initWithTitle:@"Close" style:UIBarButtonItemStyleBordered
|
262
|
+
target:self action:@selector(close_clicked:)];
|
263
|
+
[toolbar setItems:[NSArray arrayWithObjects:closeButton,nil]];
|
264
|
+
[self.view addSubview:toolbar];
|
216
265
|
[closeButton release];
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
266
|
+
|
267
|
+
CGRect rectMapArea = CGRectMake(0, 0, rootViewWidth, rootViewHeight - toolbarHeight);
|
268
|
+
mapView=[[MKMapView alloc] initWithFrame:rectMapArea];
|
269
|
+
mapView.delegate=self;
|
221
270
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
//geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:location];
|
231
|
-
//geoCoder.delegate=self;
|
232
|
-
//[geoCoder start];
|
233
|
-
|
271
|
+
mapView.showsUserLocation=showsUserLocation;
|
272
|
+
mapView.scrollEnabled=scrollEnabled;
|
273
|
+
mapView.zoomEnabled=zoomEnabled;
|
274
|
+
mapView.mapType=mapType;
|
275
|
+
|
276
|
+
/*Geocoder Stuff*/
|
277
|
+
[ggeoCoder start];
|
234
278
|
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
[mapView regionThatFits:region];
|
239
|
-
}
|
279
|
+
//geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:location];
|
280
|
+
//geoCoder.delegate=self;
|
281
|
+
//[geoCoder start];
|
240
282
|
|
241
|
-
|
242
|
-
|
283
|
+
/*Region and Zoom*/
|
284
|
+
if (region_set) {
|
285
|
+
[mapView setRegion:region animated:TRUE];
|
286
|
+
[mapView regionThatFits:region];
|
287
|
+
}
|
288
|
+
|
289
|
+
[self.view insertSubview:mapView atIndex:0];
|
243
290
|
}
|
244
291
|
|
245
292
|
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view
|
@@ -293,7 +340,19 @@
|
|
293
340
|
}
|
294
341
|
|
295
342
|
- (void)didFindAddress:(MapAnnotation*)annotation {
|
296
|
-
[
|
343
|
+
if ([[annotation type] isEqualToString:@"center"]) {
|
344
|
+
MKCoordinateSpan span;
|
345
|
+
span.latitudeDelta = region_radius;
|
346
|
+
span.longitudeDelta = region_radius;
|
347
|
+
region.center = annotation.coordinate;
|
348
|
+
region.span = span;
|
349
|
+
region_set = TRUE;
|
350
|
+
|
351
|
+
[mapView setRegion:region animated:YES];
|
352
|
+
[mapView regionThatFits:region];
|
353
|
+
}
|
354
|
+
else
|
355
|
+
[mapView addAnnotation:annotation];
|
297
356
|
}
|
298
357
|
|
299
358
|
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
|
@@ -12,6 +12,7 @@
|
|
12
12
|
#import "AppManager.h"
|
13
13
|
#import "RhoMainView.h"
|
14
14
|
|
15
|
+
#import "SplashViewController.h"
|
15
16
|
#import "LogOptionsController.h"
|
16
17
|
#import "LogViewController.h"
|
17
18
|
#import "DateTimePickerDelegate.h"
|
@@ -25,6 +26,7 @@
|
|
25
26
|
UIWindow *window;
|
26
27
|
AVAudioPlayer *player;
|
27
28
|
// Controllers
|
29
|
+
SplashViewController *splashViewController;
|
28
30
|
LogOptionsController* logOptionsController;
|
29
31
|
LogViewController* logViewController;
|
30
32
|
DateTimePickerDelegate* dateTimePickerDelegate;
|
@@ -207,6 +207,13 @@ static Rhodes *instance = NULL;
|
|
207
207
|
- (void)setMainView:(id<RhoMainView,NSObject>)view {
|
208
208
|
if (mainView == view)
|
209
209
|
return;
|
210
|
+
|
211
|
+
if (splashViewController) {
|
212
|
+
[splashViewController hideSplash];
|
213
|
+
[splashViewController release];
|
214
|
+
splashViewController = nil;
|
215
|
+
}
|
216
|
+
|
210
217
|
[mainView.view removeFromSuperview];
|
211
218
|
[mainView release];
|
212
219
|
mainView = [view retain];
|
@@ -218,9 +225,14 @@ static Rhodes *instance = NULL;
|
|
218
225
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
219
226
|
|
220
227
|
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
|
228
|
+
NSString *pngPath = [NSString stringWithFormat:@"%@/apps/app/loading.png", resourcePath];
|
221
229
|
NSString *htmPath = [NSString stringWithFormat:@"%@/apps/app/loading.html", resourcePath];
|
222
230
|
|
223
|
-
if ([fileManager fileExistsAtPath:
|
231
|
+
if ([fileManager fileExistsAtPath:pngPath]) {
|
232
|
+
splashViewController = [[SplashViewController alloc] initWithParentView:window];
|
233
|
+
[splashViewController showSplash:pngPath];
|
234
|
+
}
|
235
|
+
else if ([fileManager fileExistsAtPath:htmPath]) {
|
224
236
|
NSError *err;
|
225
237
|
NSString *data = [NSString stringWithContentsOfFile:htmPath encoding:NSUTF8StringEncoding error:&err];
|
226
238
|
[mainView loadHTMLString:data];
|
@@ -66,6 +66,10 @@
|
|
66
66
|
tabbar.view.frame = frame;
|
67
67
|
tabbar.selectedIndex = 0;
|
68
68
|
|
69
|
+
CGRect childFrame = frame;
|
70
|
+
CGRect tbFrame = tabbar.tabBar.frame;
|
71
|
+
childFrame.size.height -= tbFrame.size.height;
|
72
|
+
|
69
73
|
int count = [items count]/4;
|
70
74
|
NSMutableArray *views = [NSMutableArray arrayWithCapacity:count];
|
71
75
|
NSMutableArray *tabs = [[NSMutableArray alloc] initWithCapacity:count];
|
@@ -82,7 +86,7 @@
|
|
82
86
|
td.url = url;
|
83
87
|
td.reload = [reload isEqualToString:@"true"];
|
84
88
|
|
85
|
-
SimpleMainView *subController = [[SimpleMainView alloc] initWithParentView:tabbar.view];
|
89
|
+
SimpleMainView *subController = [[SimpleMainView alloc] initWithParentView:tabbar.view frame:childFrame];
|
86
90
|
subController.title = label;
|
87
91
|
NSString *imagePath = [[AppManager getApplicationsRootPath] stringByAppendingPathComponent:icon];
|
88
92
|
subController.tabBarItem.image = [UIImage imageWithContentsOfFile:imagePath];
|
@@ -102,11 +106,6 @@
|
|
102
106
|
self.tabbarData = tabs;
|
103
107
|
[tabs release];
|
104
108
|
|
105
|
-
CGRect vFrame = tabbar.view.frame;
|
106
|
-
CGRect tbFrame = tabbar.tabBar.frame;
|
107
|
-
tbFrame.origin.y = vFrame.size.height - tbFrame.size.height - vFrame.origin.y;
|
108
|
-
tabbar.tabBar.frame = tbFrame;
|
109
|
-
|
110
109
|
return self;
|
111
110
|
}
|
112
111
|
|
@@ -68,10 +68,10 @@ public:
|
|
68
68
|
struct tm* locTime = localtime(&m_nativeTime);
|
69
69
|
|
70
70
|
if (inFileFormat)
|
71
|
-
nSize = sprintf(timeBuf, "%02d%02d%04d%02d%02d%02d", locTime->tm_mon, locTime->tm_mday, locTime->tm_year + 1900,
|
71
|
+
nSize = sprintf(timeBuf, "%02d%02d%04d%02d%02d%02d", locTime->tm_mon+1, locTime->tm_mday, locTime->tm_year + 1900,
|
72
72
|
locTime->tm_hour, locTime->tm_min, locTime->tm_sec );
|
73
73
|
else
|
74
|
-
nSize = sprintf(timeBuf, "%02d/%02d/%04d %02d:%02d:%02d", locTime->tm_mon, locTime->tm_mday, locTime->tm_year + 1900,
|
74
|
+
nSize = sprintf(timeBuf, "%02d/%02d/%04d %02d:%02d:%02d", locTime->tm_mon+1, locTime->tm_mday, locTime->tm_year + 1900,
|
75
75
|
locTime->tm_hour, locTime->tm_min, locTime->tm_sec );
|
76
76
|
}
|
77
77
|
|
@@ -635,7 +635,7 @@ void CRhodesApp::callScreenRotationCallback(int width, int height, int degrees)
|
|
635
635
|
String strBody = "rho_callback=1";
|
636
636
|
|
637
637
|
strBody += "&width="; strBody += convertToStringA(width);
|
638
|
-
strBody += "&
|
638
|
+
strBody += "&height="; strBody += convertToStringA(height);
|
639
639
|
strBody += "°rees="; strBody += convertToStringA(degrees);
|
640
640
|
|
641
641
|
if ( m_strScreenRotationCallbackParams.length() > 0 )
|
@@ -806,6 +806,12 @@ void* rho_db_get_handle(void* pDB)
|
|
806
806
|
return db.getDbHandle();
|
807
807
|
}
|
808
808
|
|
809
|
+
void* rho_db_user_get_handle()
|
810
|
+
{
|
811
|
+
rho::db::CDBAdapter& db = rho::db::CDBAdapter::getUserDB();
|
812
|
+
return db.getDbHandle();
|
813
|
+
}
|
814
|
+
|
809
815
|
int rho_db_prepare_statement(void* pDB, const char* szSql, int nByte, sqlite3_stmt **ppStmt)
|
810
816
|
{
|
811
817
|
rho::db::CDBAdapter& db = *((rho::db::CDBAdapter*)pDB);
|
@@ -182,10 +182,30 @@ INetResponse* CURLNetRequest::pushMultipartData(const String& strUrl, VectorPtr<
|
|
182
182
|
|
183
183
|
curl_httppost *post = NULL, *last = NULL;
|
184
184
|
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL);
|
185
|
+
|
185
186
|
for (size_t i = 0, lim = arItems.size(); i < lim; ++i) {
|
186
187
|
CMultipartItem *mi = arItems[i];
|
187
188
|
|
188
|
-
|
189
|
+
size_t cl;
|
190
|
+
if (mi->m_strFilePath.empty())
|
191
|
+
cl = mi->m_strBody.size();
|
192
|
+
else {
|
193
|
+
common::CRhoFile f;
|
194
|
+
if (!f.open(mi->m_strFilePath.c_str(), common::CRhoFile::OpenReadOnly))
|
195
|
+
cl = 0;
|
196
|
+
else {
|
197
|
+
cl = f.size();
|
198
|
+
f.close();
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
char buf[32];
|
203
|
+
buf[sizeof(buf) - 1] = '\0';
|
204
|
+
snprintf(buf, sizeof(buf) - 1, "Content-Length: %lu", (unsigned long)cl);
|
205
|
+
curl_slist *fh = NULL;
|
206
|
+
fh = curl_slist_append(fh, buf);
|
207
|
+
|
208
|
+
const char *name = mi->m_strName.empty() ? "blob" : mi->m_strName.c_str();
|
189
209
|
int opt = mi->m_strFilePath.empty() ? CURLFORM_COPYCONTENTS : CURLFORM_FILE;
|
190
210
|
const char *data = mi->m_strFilePath.empty() ? mi->m_strBody.c_str() : mi->m_strFilePath.c_str();
|
191
211
|
const char *ct = mi->m_strContentType.empty() ? NULL : mi->m_strContentType.c_str();
|
@@ -194,12 +214,14 @@ INetResponse* CURLNetRequest::pushMultipartData(const String& strUrl, VectorPtr<
|
|
194
214
|
CURLFORM_COPYNAME, name,
|
195
215
|
opt, data,
|
196
216
|
CURLFORM_CONTENTTYPE, ct,
|
217
|
+
CURLFORM_CONTENTHEADER, fh,
|
197
218
|
CURLFORM_END);
|
198
219
|
}
|
199
220
|
else {
|
200
221
|
curl_formadd(&post, &last,
|
201
222
|
CURLFORM_COPYNAME, name,
|
202
223
|
opt, data,
|
224
|
+
CURLFORM_CONTENTHEADER, fh,
|
203
225
|
CURLFORM_END);
|
204
226
|
}
|
205
227
|
}
|