rhodes 3.2.0.beta.1 → 3.2.0.beta.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +1 -0
- data/Manifest.txt +7307 -0
- data/doc/device-caps.txt +10 -7
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +1 -1
- data/platform/iphone/Classes/MapView/MapViewManager.m +2 -0
- data/platform/iphone/Classes/MapView/RhoMapViewController.h +60 -0
- data/platform/iphone/Classes/MapView/RhoMapViewController.m +217 -0
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +64 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +6 -0
- data/platform/shared/common/map/MapEngine.cpp +56 -1
- data/platform/shared/common/map/MapEngine.h +1 -1
- data/platform/shared/ruby/ext/mapview/mapview.i +2 -2
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +13 -102
- data/rhodes.gemspec +1 -1
- metadata +6 -3
@@ -462,8 +462,63 @@ private:
|
|
462
462
|
};
|
463
463
|
|
464
464
|
|
465
|
-
int mapview_preload_map_tiles(
|
465
|
+
int mapview_preload_map_tiles(rho_param* p, const char* callback)
|
466
466
|
{
|
467
|
+
if (p == NULL) {
|
468
|
+
return 0;
|
469
|
+
}
|
470
|
+
if (p->type != RHO_PARAM_HASH) {
|
471
|
+
RAWLOG_ERROR("preload_map_tiles: first params must be HASH!");
|
472
|
+
return 0;
|
473
|
+
|
474
|
+
}
|
475
|
+
|
476
|
+
char* engine = NULL;
|
477
|
+
char* map_type = NULL;
|
478
|
+
double top_latitude = 0;
|
479
|
+
double left_longitude = 0;
|
480
|
+
double bottom_latitude = 0;
|
481
|
+
double right_longitude = 0;
|
482
|
+
int min_zoom = 0;
|
483
|
+
int max_zoom = 0;
|
484
|
+
|
485
|
+
|
486
|
+
for (int j = 0, limm = p->v.hash->size; j < limm; ++j) {
|
487
|
+
char *name = p->v.hash->name[j];
|
488
|
+
rho_param *value = p->v.hash->value[j];
|
489
|
+
if (!name || !value)
|
490
|
+
continue;
|
491
|
+
if (value->type != RHO_PARAM_STRING)
|
492
|
+
continue;
|
493
|
+
char *v = value->v.string;
|
494
|
+
|
495
|
+
if (strcasecmp(name, "engine") == 0) {
|
496
|
+
engine = v;
|
497
|
+
}
|
498
|
+
else if (strcasecmp(name, "map_type") == 0) {
|
499
|
+
map_type = v;
|
500
|
+
}
|
501
|
+
else if (strcasecmp(name, "top_latitude") == 0) {
|
502
|
+
top_latitude = strtod(v, NULL);
|
503
|
+
}
|
504
|
+
else if (strcasecmp(name, "left_longitude") == 0) {
|
505
|
+
left_longitude = strtod(v, NULL);
|
506
|
+
}
|
507
|
+
else if (strcasecmp(name, "bottom_latitude") == 0) {
|
508
|
+
bottom_latitude = strtod(v, NULL);
|
509
|
+
}
|
510
|
+
else if (strcasecmp(name, "right_longitude") == 0) {
|
511
|
+
right_longitude = strtod(v, NULL);
|
512
|
+
}
|
513
|
+
else if (strcasecmp(name, "min_zoom") == 0) {
|
514
|
+
min_zoom = (int)strtod(v, NULL);
|
515
|
+
}
|
516
|
+
else if (strcasecmp(name, "max_zoom") == 0) {
|
517
|
+
max_zoom = (int)strtod(v, NULL);
|
518
|
+
}
|
519
|
+
}
|
520
|
+
|
521
|
+
|
467
522
|
rhomap::EmptyDrawingDevice empty_device;
|
468
523
|
std::string providerId = engine;
|
469
524
|
std::transform(providerId.begin(), providerId.end(), providerId.begin(), &::tolower);
|
@@ -341,7 +341,7 @@ bool rho_map_check_param(rho_param *p);
|
|
341
341
|
#ifdef __cplusplus
|
342
342
|
extern "C"
|
343
343
|
#endif //__cplusplus
|
344
|
-
int mapview_preload_map_tiles(
|
344
|
+
int mapview_preload_map_tiles(rho_param* p, const char* callback);
|
345
345
|
|
346
346
|
#endif
|
347
347
|
|
@@ -14,7 +14,7 @@ extern double mapview_state_center_lon();
|
|
14
14
|
#define state_center_lon mapview_state_center_lon
|
15
15
|
extern void mapview_set_file_caching_enable(int enable);
|
16
16
|
#define set_file_caching_enable mapview_set_file_caching_enable
|
17
|
-
extern int mapview_preload_map_tiles(
|
17
|
+
extern int mapview_preload_map_tiles(rho_param* p, const char* callback);
|
18
18
|
#define preload_map_tiles mapview_preload_map_tiles
|
19
19
|
%}
|
20
20
|
|
@@ -32,5 +32,5 @@ extern VALUE state_started();
|
|
32
32
|
extern double state_center_lat();
|
33
33
|
extern double state_center_lon();
|
34
34
|
extern void set_file_caching_enable(int enable);
|
35
|
-
extern int preload_map_tiles(
|
35
|
+
extern int preload_map_tiles(rho_param* p, const char* callback);
|
36
36
|
|
@@ -1828,7 +1828,7 @@ extern double mapview_state_center_lon();
|
|
1828
1828
|
#define state_center_lon mapview_state_center_lon
|
1829
1829
|
extern void mapview_set_file_caching_enable(int enable);
|
1830
1830
|
#define set_file_caching_enable mapview_set_file_caching_enable
|
1831
|
-
extern int mapview_preload_map_tiles(
|
1831
|
+
extern int mapview_preload_map_tiles(rho_param* p, const char* callback);
|
1832
1832
|
#define preload_map_tiles mapview_preload_map_tiles
|
1833
1833
|
|
1834
1834
|
|
@@ -1951,35 +1951,6 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
|
1951
1951
|
|
1952
1952
|
|
1953
1953
|
|
1954
|
-
/*@SWIG:/usr/local/share/swig/2.0.4/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
1955
|
-
SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
|
1956
|
-
{
|
1957
|
-
VALUE obj = args[0];
|
1958
|
-
VALUE type = TYPE(obj);
|
1959
|
-
double *res = (double *)(args[1]);
|
1960
|
-
*res = NUM2DBL(obj);
|
1961
|
-
return obj;
|
1962
|
-
}
|
1963
|
-
/*@SWIG@*/
|
1964
|
-
|
1965
|
-
SWIGINTERN int
|
1966
|
-
SWIG_AsVal_double (VALUE obj, double *val)
|
1967
|
-
{
|
1968
|
-
VALUE type = TYPE(obj);
|
1969
|
-
if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
|
1970
|
-
double v;
|
1971
|
-
VALUE a[2];
|
1972
|
-
a[0] = obj;
|
1973
|
-
a[1] = (VALUE)(&v);
|
1974
|
-
if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
|
1975
|
-
if (val) *val = v;
|
1976
|
-
return SWIG_OK;
|
1977
|
-
}
|
1978
|
-
}
|
1979
|
-
return SWIG_TypeError;
|
1980
|
-
}
|
1981
|
-
|
1982
|
-
|
1983
1954
|
#define SWIG_From_long LONG2NUM
|
1984
1955
|
|
1985
1956
|
|
@@ -2095,97 +2066,37 @@ fail:
|
|
2095
2066
|
|
2096
2067
|
SWIGINTERN VALUE
|
2097
2068
|
_wrap_preload_map_tiles(int argc, VALUE *argv, VALUE self) {
|
2098
|
-
|
2069
|
+
rho_param *arg1 = (rho_param *) 0 ;
|
2099
2070
|
char *arg2 = (char *) 0 ;
|
2100
|
-
double arg3 ;
|
2101
|
-
double arg4 ;
|
2102
|
-
double arg5 ;
|
2103
|
-
double arg6 ;
|
2104
|
-
int arg7 ;
|
2105
|
-
int arg8 ;
|
2106
|
-
char *arg9 = (char *) 0 ;
|
2107
|
-
int res1 ;
|
2108
|
-
char *buf1 = 0 ;
|
2109
|
-
int alloc1 = 0 ;
|
2110
2071
|
int res2 ;
|
2111
2072
|
char *buf2 = 0 ;
|
2112
2073
|
int alloc2 = 0 ;
|
2113
|
-
double val3 ;
|
2114
|
-
int ecode3 = 0 ;
|
2115
|
-
double val4 ;
|
2116
|
-
int ecode4 = 0 ;
|
2117
|
-
double val5 ;
|
2118
|
-
int ecode5 = 0 ;
|
2119
|
-
double val6 ;
|
2120
|
-
int ecode6 = 0 ;
|
2121
|
-
int val7 ;
|
2122
|
-
int ecode7 = 0 ;
|
2123
|
-
int val8 ;
|
2124
|
-
int ecode8 = 0 ;
|
2125
|
-
int res9 ;
|
2126
|
-
char *buf9 = 0 ;
|
2127
|
-
int alloc9 = 0 ;
|
2128
2074
|
int result;
|
2129
2075
|
VALUE vresult = Qnil;
|
2130
2076
|
|
2131
|
-
if ((argc <
|
2132
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for
|
2077
|
+
if ((argc < 2) || (argc > 2)) {
|
2078
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
2133
2079
|
}
|
2134
|
-
|
2135
|
-
|
2136
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","preload_map_tiles", 1, argv[0] ));
|
2080
|
+
{
|
2081
|
+
arg1 = rho_param_fromvalue(argv[0]);
|
2137
2082
|
}
|
2138
|
-
arg1 = (char *)(buf1);
|
2139
2083
|
res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
|
2140
2084
|
if (!SWIG_IsOK(res2)) {
|
2141
2085
|
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","preload_map_tiles", 2, argv[1] ));
|
2142
2086
|
}
|
2143
2087
|
arg2 = (char *)(buf2);
|
2144
|
-
|
2145
|
-
if (!SWIG_IsOK(ecode3)) {
|
2146
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","preload_map_tiles", 3, argv[2] ));
|
2147
|
-
}
|
2148
|
-
arg3 = (double)(val3);
|
2149
|
-
ecode4 = SWIG_AsVal_double(argv[3], &val4);
|
2150
|
-
if (!SWIG_IsOK(ecode4)) {
|
2151
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","preload_map_tiles", 4, argv[3] ));
|
2152
|
-
}
|
2153
|
-
arg4 = (double)(val4);
|
2154
|
-
ecode5 = SWIG_AsVal_double(argv[4], &val5);
|
2155
|
-
if (!SWIG_IsOK(ecode5)) {
|
2156
|
-
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","preload_map_tiles", 5, argv[4] ));
|
2157
|
-
}
|
2158
|
-
arg5 = (double)(val5);
|
2159
|
-
ecode6 = SWIG_AsVal_double(argv[5], &val6);
|
2160
|
-
if (!SWIG_IsOK(ecode6)) {
|
2161
|
-
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","preload_map_tiles", 6, argv[5] ));
|
2162
|
-
}
|
2163
|
-
arg6 = (double)(val6);
|
2164
|
-
ecode7 = SWIG_AsVal_int(argv[6], &val7);
|
2165
|
-
if (!SWIG_IsOK(ecode7)) {
|
2166
|
-
SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","preload_map_tiles", 7, argv[6] ));
|
2167
|
-
}
|
2168
|
-
arg7 = (int)(val7);
|
2169
|
-
ecode8 = SWIG_AsVal_int(argv[7], &val8);
|
2170
|
-
if (!SWIG_IsOK(ecode8)) {
|
2171
|
-
SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "int","preload_map_tiles", 8, argv[7] ));
|
2172
|
-
}
|
2173
|
-
arg8 = (int)(val8);
|
2174
|
-
res9 = SWIG_AsCharPtrAndSize(argv[8], &buf9, NULL, &alloc9);
|
2175
|
-
if (!SWIG_IsOK(res9)) {
|
2176
|
-
SWIG_exception_fail(SWIG_ArgError(res9), Ruby_Format_TypeError( "", "char const *","preload_map_tiles", 9, argv[8] ));
|
2177
|
-
}
|
2178
|
-
arg9 = (char *)(buf9);
|
2179
|
-
result = (int)preload_map_tiles((char const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,(char const *)arg9);
|
2088
|
+
result = (int)preload_map_tiles(arg1,(char const *)arg2);
|
2180
2089
|
vresult = SWIG_From_int((int)(result));
|
2181
|
-
|
2090
|
+
{
|
2091
|
+
rho_param_free(arg1);
|
2092
|
+
}
|
2182
2093
|
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2183
|
-
if (alloc9 == SWIG_NEWOBJ) free((char*)buf9);
|
2184
2094
|
return vresult;
|
2185
2095
|
fail:
|
2186
|
-
|
2096
|
+
{
|
2097
|
+
rho_param_free(arg1);
|
2098
|
+
}
|
2187
2099
|
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2188
|
-
if (alloc9 == SWIG_NEWOBJ) free((char*)buf9);
|
2189
2100
|
return Qnil;
|
2190
2101
|
}
|
2191
2102
|
|
data/rhodes.gemspec
CHANGED
@@ -3,7 +3,7 @@ require "lib/rhodes.rb"
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = %q{rhodes}
|
6
|
-
s.version = "3.2.0.beta.
|
6
|
+
s.version = "3.2.0.beta.2"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
9
9
|
s.authors = ["Rhomobile"]
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 62196455
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 3.2.0.beta.
|
11
|
+
- 2
|
12
|
+
version: 3.2.0.beta.2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Rhomobile
|
@@ -1032,6 +1032,7 @@ files:
|
|
1032
1032
|
- lib/test/rho_stubs.rb
|
1033
1033
|
- lib/test/syncdb.sqlite
|
1034
1034
|
- LICENSE
|
1035
|
+
- Manifest.txt
|
1035
1036
|
- platform/android/build/android.rake
|
1036
1037
|
- platform/android/build/android_tools.rb
|
1037
1038
|
- platform/android/build/androidcommon.rb
|
@@ -1953,6 +1954,8 @@ files:
|
|
1953
1954
|
- platform/iphone/Classes/MapView/MapViewController.m
|
1954
1955
|
- platform/iphone/Classes/MapView/MapViewManager.h
|
1955
1956
|
- platform/iphone/Classes/MapView/MapViewManager.m
|
1957
|
+
- platform/iphone/Classes/MapView/RhoMapViewController.h
|
1958
|
+
- platform/iphone/Classes/MapView/RhoMapViewController.m
|
1956
1959
|
- platform/iphone/Classes/NativeBar.h
|
1957
1960
|
- platform/iphone/Classes/NativeBar.m
|
1958
1961
|
- platform/iphone/Classes/NativeView/NVDelegate.h
|