rhodes 2.2.0 → 2.2.1.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/lib/build/jake.rb +1 -1
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/error.h +14 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +10 -2
- data/platform/android/Rhodes/jni/src/rhodes.cpp +9 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +18 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +54 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +14 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +12 -3
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +2 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +4 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +8 -0
- data/platform/iphone/Classes/RhoMainView.h +2 -0
- data/platform/iphone/Classes/RhoNativeViewManager.mm +4 -2
- data/platform/iphone/Classes/SimpleMainView.h +2 -0
- data/platform/iphone/Classes/SimpleMainView.m +4 -0
- data/platform/iphone/Classes/TabbedMainView.h +2 -0
- data/platform/iphone/Classes/TabbedMainView.m +8 -0
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +27 -140
- data/platform/shared/common/RhodesApp.h +1 -1
- data/platform/shared/common/RhodesAppBase.cpp +2 -1
- data/platform/shared/rubyext/System.cpp +6 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +12 -0
- data/rhodes.gemspec +1 -1
- data/spec/phone_spec/app/spec_runner.rb +1 -1
- metadata +7 -5
data/CHANGELOG
CHANGED
data/lib/build/jake.rb
CHANGED
@@ -104,6 +104,7 @@ extern int _zbar_verbosity;
|
|
104
104
|
|
105
105
|
#else
|
106
106
|
|
107
|
+
/*
|
107
108
|
# ifdef __GNUC__
|
108
109
|
# define zprintf(level, format, args...) do { \
|
109
110
|
fprintf(stderr, "%s: " format, __func__ , ##args); \
|
@@ -115,6 +116,19 @@ extern int _zbar_verbosity;
|
|
115
116
|
ZFLUSH \
|
116
117
|
} while(0)
|
117
118
|
# endif
|
119
|
+
*/
|
120
|
+
|
121
|
+
// Disable console output
|
122
|
+
# ifdef __GNUC__
|
123
|
+
# define zprintf(level, format, args...) do { \
|
124
|
+
} while(0)
|
125
|
+
# else
|
126
|
+
# define zprintf(level, format, ...) do { \
|
127
|
+
} while(0)
|
128
|
+
# endif
|
129
|
+
|
130
|
+
|
131
|
+
|
118
132
|
|
119
133
|
#endif
|
120
134
|
|
data/lib/framework/rhodes.rb
CHANGED
data/lib/framework/version.rb
CHANGED
data/lib/rhodes.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
2
2
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
3
3
|
package="com.rhomobile.rhodes"
|
4
|
-
android:versionCode="
|
5
|
-
android:versionName="2.2.
|
4
|
+
android:versionCode="23"
|
5
|
+
android:versionName="2.2.1">
|
6
6
|
<uses-sdk android:minSdkVersion="3" />
|
7
7
|
<application android:icon="@drawable/icon"
|
8
8
|
android:multiprocess="true"
|
@@ -45,6 +45,14 @@ JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_startRhodesApp
|
|
45
45
|
JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_doSyncAllSources
|
46
46
|
(JNIEnv *, jobject, jboolean);
|
47
47
|
|
48
|
+
/*
|
49
|
+
* Class: com_rhomobile_rhodes_RhodesService
|
50
|
+
* Method: doSyncSource
|
51
|
+
* Signature: (Ljava/lang/String;)V
|
52
|
+
*/
|
53
|
+
JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_doSyncSource
|
54
|
+
(JNIEnv *, jobject, jstring);
|
55
|
+
|
48
56
|
/*
|
49
57
|
* Class: com_rhomobile_rhodes_RhodesService
|
50
58
|
* Method: getOptionsUrl
|
@@ -160,9 +168,9 @@ JNIEXPORT void JNICALL Java_com_rhomobile_rhodes_RhodesService_setPushRegistrati
|
|
160
168
|
/*
|
161
169
|
* Class: com_rhomobile_rhodes_RhodesService
|
162
170
|
* Method: callPushCallback
|
163
|
-
* Signature: (Ljava/lang/String;)
|
171
|
+
* Signature: (Ljava/lang/String;)Z
|
164
172
|
*/
|
165
|
-
JNIEXPORT
|
173
|
+
JNIEXPORT jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_callPushCallback
|
166
174
|
(JNIEnv *, jobject, jstring);
|
167
175
|
|
168
176
|
#ifdef __cplusplus
|
@@ -420,6 +420,13 @@ RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_doSyncAllSources
|
|
420
420
|
rho_sync_doSyncAllSources(show_status_popup);
|
421
421
|
}
|
422
422
|
|
423
|
+
RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_doSyncSource
|
424
|
+
(JNIEnv *env, jobject, jstring sourceObj)
|
425
|
+
{
|
426
|
+
std::string source = rho_cast<std::string>(env, sourceObj);
|
427
|
+
rho_sync_doSyncSourceByName(source.c_str());
|
428
|
+
}
|
429
|
+
|
423
430
|
RHO_GLOBAL jstring JNICALL Java_com_rhomobile_rhodes_RhodesService_getOptionsUrl
|
424
431
|
(JNIEnv *env, jobject)
|
425
432
|
{
|
@@ -502,11 +509,11 @@ RHO_GLOBAL void JNICALL Java_com_rhomobile_rhodes_RhodesService_setPushRegistrat
|
|
502
509
|
rho::sync::CClientRegister::Create(new rho::common::CRhoClassFactory, id.c_str());
|
503
510
|
}
|
504
511
|
|
505
|
-
RHO_GLOBAL
|
512
|
+
RHO_GLOBAL jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_callPushCallback
|
506
513
|
(JNIEnv *env, jobject, jstring jData)
|
507
514
|
{
|
508
515
|
std::string data = rho_cast<std::string>(env, jData);
|
509
|
-
rho_rhodesapp_callPushCallback(data.c_str());
|
516
|
+
return (jboolean)rho_rhodesapp_callPushCallback(data.c_str());
|
510
517
|
}
|
511
518
|
|
512
519
|
RHO_GLOBAL char *rho_timezone()
|
@@ -1,5 +1,6 @@
|
|
1
1
|
package com.rhomobile.rhodes;
|
2
2
|
|
3
|
+
import android.app.Activity;
|
3
4
|
import android.content.BroadcastReceiver;
|
4
5
|
import android.content.Context;
|
5
6
|
import android.content.Intent;
|
@@ -47,12 +48,25 @@ public class PushReceiver extends BroadcastReceiver {
|
|
47
48
|
@Override
|
48
49
|
public void onReceive(Context context, Intent intent) {
|
49
50
|
String action = intent.getAction();
|
50
|
-
if (action.equals(PushService.C2DM_INTENT_PREFIX + "REGISTRATION"))
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
if (action.equals(PushService.C2DM_INTENT_PREFIX + "REGISTRATION")) {
|
52
|
+
try {
|
53
|
+
handleRegistration(context, intent);
|
54
|
+
}
|
55
|
+
catch (Exception e) {
|
56
|
+
Log.e(TAG, "Can't handle PUSH registration: " + e.getMessage());
|
57
|
+
}
|
58
|
+
}
|
59
|
+
else if (action.equals(PushService.C2DM_INTENT_PREFIX + "RECEIVE")) {
|
60
|
+
try {
|
61
|
+
handleMessage(context, intent);
|
62
|
+
}
|
63
|
+
catch (Exception e) {
|
64
|
+
Log.e(TAG, "Can't handle PUSH message: " + e.getMessage());
|
65
|
+
}
|
66
|
+
}
|
54
67
|
else
|
55
68
|
Log.w(TAG, "Unknown action received (PUSH): " + action);
|
69
|
+
setResult(Activity.RESULT_OK, null /* data */, null /* extra */);
|
56
70
|
}
|
57
71
|
|
58
72
|
}
|
@@ -27,7 +27,7 @@ public class PushService {
|
|
27
27
|
|
28
28
|
checkCapabilities();
|
29
29
|
|
30
|
-
Logger.D(TAG, "Register for PUSH messages");
|
30
|
+
Logger.D(TAG, "Register for PUSH messages (use \"" + Push.SENDER + "\" as sender)");
|
31
31
|
|
32
32
|
Context ctx = RhodesService.getInstance().getContext();
|
33
33
|
Intent registrationIntent = new Intent(C2DM_INTENT_PREFIX + "REGISTER");
|
@@ -9,6 +9,7 @@ import java.util.Set;
|
|
9
9
|
import java.util.TimeZone;
|
10
10
|
import java.util.Vector;
|
11
11
|
|
12
|
+
import com.rhomobile.rhodes.alert.Alert;
|
12
13
|
import com.rhomobile.rhodes.bluetooth.RhoBluetoothManager;
|
13
14
|
import com.rhomobile.rhodes.file.RhoFileApi;
|
14
15
|
import com.rhomobile.rhodes.geolocation.GeoLocation;
|
@@ -135,6 +136,7 @@ public class RhodesService {
|
|
135
136
|
private native void startRhodesApp();
|
136
137
|
|
137
138
|
public native void doSyncAllSources(boolean v);
|
139
|
+
public native void doSyncSource(String source);
|
138
140
|
|
139
141
|
public native String getOptionsUrl();
|
140
142
|
public native String getStartUrl();
|
@@ -686,6 +688,11 @@ public class RhodesService {
|
|
686
688
|
else if (name.equalsIgnoreCase("device_name")) {
|
687
689
|
return Build.DEVICE;
|
688
690
|
}
|
691
|
+
else if (name.equalsIgnoreCase("is_emulator"))
|
692
|
+
{
|
693
|
+
String strDevice = Build.DEVICE;
|
694
|
+
return new Boolean(strDevice != null && strDevice.equalsIgnoreCase("generic"));
|
695
|
+
}
|
689
696
|
else if (name.equalsIgnoreCase("os_version")) {
|
690
697
|
return Build.VERSION.RELEASE;
|
691
698
|
}
|
@@ -705,7 +712,7 @@ public class RhodesService {
|
|
705
712
|
|
706
713
|
public native void setPushRegistrationId(String id);
|
707
714
|
|
708
|
-
private native
|
715
|
+
private native boolean callPushCallback(String data);
|
709
716
|
|
710
717
|
public void handlePushMessage(Intent intent) {
|
711
718
|
Logger.D(TAG, "Receive PUSH message");
|
@@ -719,6 +726,10 @@ public class RhodesService {
|
|
719
726
|
StringBuilder builder = new StringBuilder();
|
720
727
|
|
721
728
|
Set<String> keys = extras.keySet();
|
729
|
+
// Remove system related keys
|
730
|
+
keys.remove("collapse_key");
|
731
|
+
keys.remove("from");
|
732
|
+
|
722
733
|
for (String key : keys) {
|
723
734
|
Logger.D(TAG, "PUSH item: " + key);
|
724
735
|
Object value = extras.get(key);
|
@@ -732,9 +743,49 @@ public class RhodesService {
|
|
732
743
|
|
733
744
|
String data = builder.toString();
|
734
745
|
Logger.D(TAG, "Received PUSH message: " + data);
|
735
|
-
callPushCallback(data)
|
746
|
+
if (callPushCallback(data))
|
747
|
+
return;
|
736
748
|
|
737
|
-
|
749
|
+
String alert = extras.getString("alert");
|
750
|
+
if (alert != null) {
|
751
|
+
Logger.D(TAG, "PUSH: Alert: " + alert);
|
752
|
+
Alert.showPopup(alert);
|
753
|
+
}
|
754
|
+
String sound = extras.getString("sound");
|
755
|
+
if (sound != null) {
|
756
|
+
Logger.D(TAG, "PUSH: Sound file name: " + sound);
|
757
|
+
Alert.playFile("/public/alerts/" + sound, null);
|
758
|
+
}
|
759
|
+
String vibrate = extras.getString("vibrate");
|
760
|
+
if (vibrate != null) {
|
761
|
+
Logger.D(TAG, "PUSH: Vibrate: " + vibrate);
|
762
|
+
int duration;
|
763
|
+
try {
|
764
|
+
duration = Integer.parseInt(vibrate);
|
765
|
+
}
|
766
|
+
catch (NumberFormatException e) {
|
767
|
+
duration = 5;
|
768
|
+
}
|
769
|
+
Logger.D(TAG, "Vibrate " + duration + " seconds");
|
770
|
+
Alert.vibrate(duration);
|
771
|
+
}
|
772
|
+
|
773
|
+
String syncSources = extras.getString("do_sync");
|
774
|
+
if (syncSources != null) {
|
775
|
+
Logger.D(TAG, "PUSH: Sync:");
|
776
|
+
boolean syncAll = false;
|
777
|
+
for (String source : syncSources.split(",")) {
|
778
|
+
Logger.D(TAG, "url = " + source);
|
779
|
+
if (source.equalsIgnoreCase("all"))
|
780
|
+
syncAll = true;
|
781
|
+
else {
|
782
|
+
doSyncSource(source.trim());
|
783
|
+
}
|
784
|
+
}
|
785
|
+
|
786
|
+
if (syncAll)
|
787
|
+
doSyncAllSources(true);
|
788
|
+
}
|
738
789
|
}
|
739
790
|
|
740
791
|
}
|
@@ -21,6 +21,7 @@
|
|
21
21
|
package com.rhomobile.rhodes.alert;
|
22
22
|
|
23
23
|
import java.io.File;
|
24
|
+
import java.io.FileInputStream;
|
24
25
|
import java.util.Map;
|
25
26
|
import java.util.Vector;
|
26
27
|
|
@@ -54,6 +55,7 @@ public class Alert {
|
|
54
55
|
private static final String TAG = "Alert";
|
55
56
|
|
56
57
|
private static Dialog currentAlert = null;
|
58
|
+
private static MediaPlayer currentMP = null;
|
57
59
|
|
58
60
|
private static native void doCallback(String url, String id, String title);
|
59
61
|
|
@@ -283,14 +285,19 @@ public class Alert {
|
|
283
285
|
vibrator.vibrate(duration);
|
284
286
|
}
|
285
287
|
catch (Exception e) {
|
286
|
-
reportFail("
|
288
|
+
reportFail("vibrate", e);
|
287
289
|
}
|
288
290
|
}
|
289
291
|
|
290
292
|
public static void playFile(String fileName, String mediaType) {
|
291
293
|
try {
|
292
294
|
Logger.T(TAG, "playFile: " + fileName + " (" + mediaType + ")");
|
295
|
+
|
296
|
+
if (currentMP != null)
|
297
|
+
currentMP.release();
|
298
|
+
|
293
299
|
MediaPlayer mp = new MediaPlayer();
|
300
|
+
currentMP = mp;
|
294
301
|
mp.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
295
302
|
public boolean onError(MediaPlayer mp, int what, int extra) {
|
296
303
|
Logger.E(TAG, "Error when playing file : " + what + ", " + extra);
|
@@ -302,9 +309,14 @@ public class Alert {
|
|
302
309
|
f = new File(f, fileName);
|
303
310
|
if (!f.exists())
|
304
311
|
RhoFileApi.copy(fileName);
|
312
|
+
|
305
313
|
String source = f.getCanonicalPath();
|
306
314
|
Logger.T(TAG, "Final file name: " + source);
|
307
|
-
mp.setDataSource(source);
|
315
|
+
//mp.setDataSource(source);
|
316
|
+
|
317
|
+
FileInputStream fs = new FileInputStream(f);
|
318
|
+
mp.setDataSource(fs.getFD());
|
319
|
+
|
308
320
|
mp.prepare();
|
309
321
|
mp.start();
|
310
322
|
} catch (Exception e) {
|
@@ -29,8 +29,9 @@ public class EventStore {
|
|
29
29
|
private static final String EVENTS_PRIVACY = "visibility";
|
30
30
|
|
31
31
|
private static void reportFail(String name, Exception e) {
|
32
|
-
Logger.E(TAG, "Call of \"" + name + "\" failed: " + e.getMessage());
|
33
|
-
e
|
32
|
+
Logger.E(TAG, "Call of \"" + name + "\" failed: " + e != null ? e.getMessage() : "null exception");
|
33
|
+
if ( e != null )
|
34
|
+
e.printStackTrace();
|
34
35
|
}
|
35
36
|
|
36
37
|
private static String dateToString(Date date) {
|
@@ -246,7 +247,15 @@ public class EventStore {
|
|
246
247
|
|
247
248
|
Logger.D(TAG, "delete(id)");
|
248
249
|
|
249
|
-
|
250
|
+
ContentResolver r = getContentResolver();
|
251
|
+
int rows;
|
252
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
|
253
|
+
Uri uri = ContentUris.withAppendedId(EVENTS_URI, Long.parseLong(id));
|
254
|
+
rows = getContentResolver().delete(uri, null, null);
|
255
|
+
}
|
256
|
+
else {
|
257
|
+
rows = r.delete(EVENTS_URI, "_id=?", new String[] {id});
|
258
|
+
}
|
250
259
|
Logger.D(TAG, String.format("%d rows deleted", rows));
|
251
260
|
|
252
261
|
return null;
|
@@ -112,7 +112,8 @@ public class RhodesApp
|
|
112
112
|
{
|
113
113
|
return strUrl.startsWith("http://") || strUrl.startsWith("https://") ||
|
114
114
|
strUrl.startsWith("javascript:") || strUrl.startsWith("mailto:")
|
115
|
-
|| strUrl.startsWith("tel:")|| strUrl.startsWith("wtai:")
|
115
|
+
|| strUrl.startsWith("tel:")|| strUrl.startsWith("wtai:") ||
|
116
|
+
strUrl.startsWith("sms:");
|
116
117
|
}
|
117
118
|
|
118
119
|
public String canonicalizeRhoUrl(String url)
|
@@ -172,6 +172,10 @@ public class System {
|
|
172
172
|
return ObjectFactory.createString(DeviceInfo.getDeviceName());
|
173
173
|
if ( strPropName.equalsIgnoreCase("os_version") )
|
174
174
|
return ObjectFactory.createString(DeviceInfo.getSoftwareVersion());
|
175
|
+
if ( strPropName.equalsIgnoreCase("rhodes_port") )
|
176
|
+
return ObjectFactory.createInteger(0);
|
177
|
+
if ( strPropName.equalsIgnoreCase("is_emulator") )
|
178
|
+
return ObjectFactory.createBoolean(DeviceInfo.isSimulator());
|
175
179
|
|
176
180
|
return RubyConstant.QNIL;
|
177
181
|
}
|
@@ -320,7 +320,15 @@ int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
|
|
320
320
|
NSString *version = [[UIDevice currentDevice] systemVersion];
|
321
321
|
*resValue = rho_ruby_create_string([version UTF8String]);
|
322
322
|
return 1;
|
323
|
+
}else if (strcasecmp("is_emulator", szPropName) == 0) {
|
324
|
+
int bSim = 0;
|
325
|
+
#if TARGET_IPHONE_SIMULATOR
|
326
|
+
bSim = 1;
|
327
|
+
#endif
|
328
|
+
*resValue = rho_ruby_create_boolean(bSim);
|
329
|
+
return 1;
|
323
330
|
}
|
331
|
+
|
324
332
|
/*
|
325
333
|
// Removed because it's possibly dangerous: Apple could reject application
|
326
334
|
// used such approach from its AppStore
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
#import "RhoNativeViewManagerOC.h"
|
14
14
|
#import "RhoNativeViewManager.h"
|
15
|
-
|
15
|
+
#import "Rhodes.h"
|
16
16
|
|
17
17
|
|
18
18
|
|
@@ -196,7 +196,7 @@ static RhoNativeViewManagerOC *instance = NULL;
|
|
196
196
|
}
|
197
197
|
|
198
198
|
+(UIWebView*)getWebViewObject:(int)tab_index {
|
199
|
-
return
|
199
|
+
return [[[Rhodes sharedInstance] mainView] getWebView:tab_index];
|
200
200
|
}
|
201
201
|
|
202
202
|
|
@@ -204,6 +204,7 @@ static RhoNativeViewManagerOC *instance = NULL;
|
|
204
204
|
|
205
205
|
|
206
206
|
|
207
|
+
|
207
208
|
void RhoNativeViewManager::registerViewType(const char* viewType, NativeViewFactory* factory) {
|
208
209
|
NativeViewFactoryOCImpl* f = [NativeViewFactoryOCImpl makeFactory:factory];
|
209
210
|
NSString* s = [[NSString alloc] initWithUTF8String:viewType];
|
@@ -222,3 +223,4 @@ void RhoNativeViewManager::unregisterViewType(const char* viewType) {
|
|
222
223
|
void* RhoNativeViewManager::getWebViewObject(int tab_index) {
|
223
224
|
return [RhoNativeViewManagerOC getWebViewObject:tab_index];
|
224
225
|
}
|
226
|
+
|
@@ -205,6 +205,14 @@
|
|
205
205
|
return tabindex;
|
206
206
|
}
|
207
207
|
|
208
|
+
- (UIWebView*)getWebView:(int)tab_index {
|
209
|
+
if (tab_index == -1) {
|
210
|
+
tab_index = [self activeTab];
|
211
|
+
}
|
212
|
+
return [[self subView:tab_index] getWebView:-1];
|
213
|
+
}
|
214
|
+
|
215
|
+
|
208
216
|
- (void)addNavBar:(NSString*)title left:(NSArray*)left right:(NSArray*)right {
|
209
217
|
[[self subView:[self activeTab]] addNavBar:title left:left right:right];
|
210
218
|
}
|
data/platform/iphone/Info.plist
CHANGED
@@ -27,7 +27,6 @@
|
|
27
27
|
BD38E6DC115CFF14001CE05C /* WebView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD38E6DB115CFF14001CE05C /* WebView.m */; };
|
28
28
|
BD38E755115D1AAC001CE05C /* TabbedMainView.m in Sources */ = {isa = PBXBuildFile; fileRef = BD38E754115D1AAC001CE05C /* TabbedMainView.m */; };
|
29
29
|
BD486F59124FB66600F8A93F /* Event.m in Sources */ = {isa = PBXBuildFile; fileRef = BD486F58124FB66600F8A93F /* Event.m */; };
|
30
|
-
BD486FE212505FE000F8A93F /* EventKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD486FE112505FE000F8A93F /* EventKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
|
31
30
|
BD5B744B113BE2DB00C6070A /* SplashViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BD5B7449113BE2DB00C6070A /* SplashViewController.m */; };
|
32
31
|
BD6A622A123E46BB0093E03C /* RhoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = BD6A6229123E46BB0093E03C /* RhoViewController.m */; };
|
33
32
|
BD97AC211160EE8F006960F9 /* RhoAlert.m in Sources */ = {isa = PBXBuildFile; fileRef = BD97AC201160EE8F006960F9 /* RhoAlert.m */; };
|
@@ -183,7 +182,6 @@
|
|
183
182
|
BD38E754115D1AAC001CE05C /* TabbedMainView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TabbedMainView.m; sourceTree = "<group>"; };
|
184
183
|
BD486F57124FB66600F8A93F /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = Event/Event.h; sourceTree = "<group>"; };
|
185
184
|
BD486F58124FB66600F8A93F /* Event.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Event.m; path = Event/Event.m; sourceTree = "<group>"; };
|
186
|
-
BD486FE112505FE000F8A93F /* EventKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = EventKit.framework; path = System/Library/Frameworks/EventKit.framework; sourceTree = SDKROOT; };
|
187
185
|
BD5B7448113BE2DB00C6070A /* SplashViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SplashViewController.h; sourceTree = "<group>"; };
|
188
186
|
BD5B7449113BE2DB00C6070A /* SplashViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SplashViewController.m; sourceTree = "<group>"; };
|
189
187
|
BD6A6228123E46BB0093E03C /* RhoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RhoViewController.h; sourceTree = "<group>"; };
|
@@ -282,7 +280,6 @@
|
|
282
280
|
46AD7DB31117AFB9009A974A /* MapKit.framework in Frameworks */,
|
283
281
|
46AD7DB71117AFBF009A974A /* CFNetwork.framework in Frameworks */,
|
284
282
|
FACC2100123A759A0088A447 /* GameKit.framework in Frameworks */,
|
285
|
-
BD486FE212505FE000F8A93F /* EventKit.framework in Frameworks */,
|
286
283
|
);
|
287
284
|
runOnlyForDeploymentPostprocessing = 0;
|
288
285
|
};
|
@@ -353,7 +350,6 @@
|
|
353
350
|
46AD7DB21117AFB9009A974A /* MapKit.framework */,
|
354
351
|
46AD7DB61117AFBF009A974A /* CFNetwork.framework */,
|
355
352
|
FACC20FF123A759A0088A447 /* GameKit.framework */,
|
356
|
-
BD486FE112505FE000F8A93F /* EventKit.framework */,
|
357
353
|
);
|
358
354
|
name = CustomTemplate;
|
359
355
|
sourceTree = "<group>";
|
@@ -915,7 +911,6 @@
|
|
915
911
|
CODE_SIGN_IDENTITY = "Don't Code Sign";
|
916
912
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
|
917
913
|
COPY_PHASE_STRIP = NO;
|
918
|
-
EXTENSIONS_LDFLAGS = "-filelist $(TARGET_TEMP_DIR)/rhodeslibs.txt";
|
919
914
|
GCC_DYNAMIC_NO_PIC = NO;
|
920
915
|
GCC_OPTIMIZATION_LEVEL = 0;
|
921
916
|
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
@@ -930,7 +925,6 @@
|
|
930
925
|
);
|
931
926
|
OTHER_CFLAGS = "";
|
932
927
|
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
|
933
|
-
OTHER_LDFLAGS = "$(EXTENSIONS_LDFLAGS)";
|
934
928
|
PRODUCT_NAME = rhorunner;
|
935
929
|
PROVISIONING_PROFILE = "";
|
936
930
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
@@ -963,19 +957,6 @@
|
|
963
957
|
ONLY_ACTIVE_ARCH = YES;
|
964
958
|
OTHER_CFLAGS = "";
|
965
959
|
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
|
966
|
-
OTHER_LDFLAGS = "$(EXTENSIONS_LDFLAGS)";
|
967
|
-
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
|
968
|
-
"-framework",
|
969
|
-
CFNetwork,
|
970
|
-
"-framework",
|
971
|
-
CoreGraphics,
|
972
|
-
"$(EXTENSIONS_LDFLAGS)",
|
973
|
-
);
|
974
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = (
|
975
|
-
"-framework",
|
976
|
-
CFNetwork,
|
977
|
-
"$(EXTENSIONS_LDFLAGS)",
|
978
|
-
);
|
979
960
|
PRODUCT_NAME = rhorunner;
|
980
961
|
PROVISIONING_PROFILE = "";
|
981
962
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
@@ -991,72 +972,23 @@
|
|
991
972
|
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
992
973
|
CODE_SIGN_ENTITLEMENTS = Entitlements.plist;
|
993
974
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
|
975
|
+
EXTENSIONS_LDFLAGS = "-filelist $(TARGET_TEMP_DIR)/rhodeslibs.txt";
|
994
976
|
GCC_C_LANGUAGE_STANDARD = c99;
|
995
977
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
996
978
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
997
979
|
HEADER_SEARCH_PATHS = ../shared;
|
998
980
|
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
|
999
|
-
"
|
1000
|
-
|
1001
|
-
|
1002
|
-
"-lrhosynclib",
|
1003
|
-
"-ltcmalloc",
|
1004
|
-
"-lrholib",
|
1005
|
-
"-lrhoextlib",
|
1006
|
-
);
|
1007
|
-
"OTHER_LDFLAGS[sdk=iphoneos3.0][arch=*]" = (
|
1008
|
-
"-framework",
|
1009
|
-
MapKit,
|
1010
|
-
"-framework",
|
1011
|
-
CFNetwork,
|
1012
|
-
"-lrhorubylib",
|
1013
|
-
"-lrhosynclib",
|
1014
|
-
"-ltcmalloc",
|
1015
|
-
"-lrholib",
|
1016
|
-
"-lrhoextlib",
|
1017
|
-
);
|
1018
|
-
"OTHER_LDFLAGS[sdk=iphoneos3.1][arch=*]" = (
|
1019
|
-
"-framework",
|
1020
|
-
MapKit,
|
1021
|
-
"-framework",
|
1022
|
-
CFNetwork,
|
1023
|
-
"-lrhorubylib",
|
1024
|
-
"-lrhosynclib",
|
1025
|
-
"-ltcmalloc",
|
1026
|
-
"-lrholib",
|
1027
|
-
"-lrhoextlib",
|
981
|
+
"$(EXTENSIONS_LDFLAGS)",
|
982
|
+
"-weak_framework",
|
983
|
+
EventKit,
|
1028
984
|
);
|
985
|
+
"OTHER_LDFLAGS[sdk=iphoneos3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1029
986
|
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = (
|
1030
|
-
"
|
1031
|
-
|
1032
|
-
|
1033
|
-
"-lrhosynclib",
|
1034
|
-
"-ltcmalloc",
|
1035
|
-
"-lrholib",
|
1036
|
-
"-lrhoextlib",
|
1037
|
-
);
|
1038
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator3.0][arch=*]" = (
|
1039
|
-
"-framework",
|
1040
|
-
MapKit,
|
1041
|
-
"-framework",
|
1042
|
-
CFNetwork,
|
1043
|
-
"-lrhorubylib",
|
1044
|
-
"-lrhosynclib",
|
1045
|
-
"-ltcmalloc",
|
1046
|
-
"-lrholib",
|
1047
|
-
"-lrhoextlib",
|
1048
|
-
);
|
1049
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator3.1][arch=*]" = (
|
1050
|
-
"-framework",
|
1051
|
-
MapKit,
|
1052
|
-
"-framework",
|
1053
|
-
CFNetwork,
|
1054
|
-
"-lrhorubylib",
|
1055
|
-
"-lrhosynclib",
|
1056
|
-
"-ltcmalloc",
|
1057
|
-
"-lrholib",
|
1058
|
-
"-lrhoextlib",
|
987
|
+
"$(EXTENSIONS_LDFLAGS)",
|
988
|
+
"-weak_framework",
|
989
|
+
EventKit,
|
1059
990
|
);
|
991
|
+
"OTHER_LDFLAGS[sdk=iphonesimulator3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1060
992
|
PREBINDING = NO;
|
1061
993
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
1062
994
|
SDKROOT = iphoneos3.2;
|
@@ -1086,45 +1018,6 @@
|
|
1086
1018
|
ONLY_ACTIVE_ARCH = YES;
|
1087
1019
|
OTHER_CFLAGS = "";
|
1088
1020
|
OTHER_CPLUSPLUSFLAGS = "$(OTHER_CFLAGS)";
|
1089
|
-
OTHER_LDFLAGS = "$(EXTENSIONS_LDFLAGS)";
|
1090
|
-
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
|
1091
|
-
"-framework",
|
1092
|
-
CFNetwork,
|
1093
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1094
|
-
);
|
1095
|
-
"OTHER_LDFLAGS[sdk=iphoneos3.0][arch=*]" = (
|
1096
|
-
"-framework",
|
1097
|
-
MapKit,
|
1098
|
-
"-framework",
|
1099
|
-
CFNetwork,
|
1100
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1101
|
-
);
|
1102
|
-
"OTHER_LDFLAGS[sdk=iphoneos3.1][arch=*]" = (
|
1103
|
-
"-framework",
|
1104
|
-
MapKit,
|
1105
|
-
"-framework",
|
1106
|
-
CFNetwork,
|
1107
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1108
|
-
);
|
1109
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = (
|
1110
|
-
"-framework",
|
1111
|
-
CFNetwork,
|
1112
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1113
|
-
);
|
1114
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator3.0][arch=*]" = (
|
1115
|
-
"-framework",
|
1116
|
-
MapKit,
|
1117
|
-
"-framework",
|
1118
|
-
CFNetwork,
|
1119
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1120
|
-
);
|
1121
|
-
"OTHER_LDFLAGS[sdk=iphonesimulator3.1][arch=*]" = (
|
1122
|
-
"-framework",
|
1123
|
-
MapKit,
|
1124
|
-
"-framework",
|
1125
|
-
CFNetwork,
|
1126
|
-
"$(EXTENSIONS_LDFLAGS)",
|
1127
|
-
);
|
1128
1021
|
PRODUCT_NAME = rhorunner;
|
1129
1022
|
SDKROOT = iphoneos4.0;
|
1130
1023
|
TARGETED_DEVICE_FAMILY = "1,2";
|
@@ -1139,6 +1032,7 @@
|
|
1139
1032
|
CODE_SIGN_ENTITLEMENTS = "";
|
1140
1033
|
CODE_SIGN_IDENTITY = "Don't Code Sign";
|
1141
1034
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
|
1035
|
+
EXTENSIONS_LDFLAGS = "-filelist $(TARGET_TEMP_DIR)/rhodeslibs.txt";
|
1142
1036
|
GCC_C_LANGUAGE_STANDARD = c99;
|
1143
1037
|
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
|
1144
1038
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
@@ -1147,19 +1041,17 @@
|
|
1147
1041
|
IBC_FLATTEN_NIBS = YES;
|
1148
1042
|
ONLY_ACTIVE_ARCH = YES;
|
1149
1043
|
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
|
1150
|
-
"
|
1151
|
-
"-
|
1152
|
-
|
1153
|
-
"-lrholib",
|
1154
|
-
"-lrhoextlib",
|
1044
|
+
"$(EXTENSIONS_LDFLAGS)",
|
1045
|
+
"-weak_framework",
|
1046
|
+
EventKit,
|
1155
1047
|
);
|
1048
|
+
"OTHER_LDFLAGS[sdk=iphoneos3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1156
1049
|
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = (
|
1157
|
-
"
|
1158
|
-
"-
|
1159
|
-
|
1160
|
-
"-lrholib",
|
1161
|
-
"-lrhoextlib",
|
1050
|
+
"$(EXTENSIONS_LDFLAGS)",
|
1051
|
+
"-weak_framework",
|
1052
|
+
EventKit,
|
1162
1053
|
);
|
1054
|
+
"OTHER_LDFLAGS[sdk=iphonesimulator3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1163
1055
|
PREBINDING = NO;
|
1164
1056
|
PROVISIONING_PROFILE = "";
|
1165
1057
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
@@ -1175,28 +1067,23 @@
|
|
1175
1067
|
buildSettings = {
|
1176
1068
|
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
1177
1069
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Don't Code Sign";
|
1070
|
+
EXTENSIONS_LDFLAGS = "-filelist $(TARGET_TEMP_DIR)/rhodeslibs.txt";
|
1178
1071
|
GCC_C_LANGUAGE_STANDARD = c99;
|
1179
1072
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
1180
1073
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
1181
1074
|
HEADER_SEARCH_PATHS = ../shared;
|
1182
1075
|
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
|
1183
|
-
"
|
1184
|
-
|
1185
|
-
|
1186
|
-
"-lrhosynclib",
|
1187
|
-
"-ltcmalloc",
|
1188
|
-
"-lrholib",
|
1189
|
-
"-lrhoextlib",
|
1076
|
+
"$(EXTENSIONS_LDFLAGS)",
|
1077
|
+
"-weak_framework",
|
1078
|
+
EventKit,
|
1190
1079
|
);
|
1080
|
+
"OTHER_LDFLAGS[sdk=iphoneos3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1191
1081
|
"OTHER_LDFLAGS[sdk=iphonesimulator*][arch=*]" = (
|
1192
|
-
"
|
1193
|
-
|
1194
|
-
|
1195
|
-
"-lrhosynclib",
|
1196
|
-
"-ltcmalloc",
|
1197
|
-
"-lrholib",
|
1198
|
-
"-lrhoextlib",
|
1082
|
+
"$(EXTENSIONS_LDFLAGS)",
|
1083
|
+
"-weak_framework",
|
1084
|
+
EventKit,
|
1199
1085
|
);
|
1086
|
+
"OTHER_LDFLAGS[sdk=iphonesimulator3.2][arch=*]" = "$(EXTENSIONS_LDFLAGS)";
|
1200
1087
|
PREBINDING = NO;
|
1201
1088
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
1202
1089
|
SDKROOT = iphoneos3.2;
|
@@ -110,6 +110,7 @@ public:
|
|
110
110
|
void loadUrl(String url);
|
111
111
|
|
112
112
|
boolean isLocalServerStarted();
|
113
|
+
const char* getFreeListeningPort();
|
113
114
|
|
114
115
|
protected:
|
115
116
|
virtual void run();
|
@@ -117,7 +118,6 @@ protected:
|
|
117
118
|
void initHttpServer();
|
118
119
|
void initAppUrls();
|
119
120
|
|
120
|
-
const char* getFreeListeningPort();
|
121
121
|
net::INetRequest& getNet(){ return *m_NetRequest; }
|
122
122
|
};
|
123
123
|
|
@@ -56,7 +56,8 @@ String CRhodesAppBase::canonicalizeRhoUrl(const String& strUrl)
|
|
56
56
|
strncmp("javascript:", strUrl.c_str(), 11 ) == 0 ||
|
57
57
|
strncmp("mailto:", strUrl.c_str(), 7) == 0 ||
|
58
58
|
strncmp("tel:", strUrl.c_str(), 4) == 0 ||
|
59
|
-
strncmp("wtai:", strUrl.c_str(), 5) == 0
|
59
|
+
strncmp("wtai:", strUrl.c_str(), 5) == 0 ||
|
60
|
+
strncmp("sms:", strUrl.c_str(), 4) == 0
|
60
61
|
)
|
61
62
|
return strUrl;
|
62
63
|
|
@@ -50,6 +50,12 @@ VALUE rho_sys_get_property(char* szPropName)
|
|
50
50
|
if (strcasecmp("full_browser",szPropName) == 0)
|
51
51
|
return rho_ruby_create_boolean(1);
|
52
52
|
|
53
|
+
if (strcasecmp("rhodes_port",szPropName) == 0)
|
54
|
+
return rho_ruby_create_integer(atoi(RHODESAPP().getFreeListeningPort()));
|
55
|
+
|
56
|
+
if (strcasecmp("is_emulator",szPropName) == 0)
|
57
|
+
return rho_ruby_create_boolean(0);
|
58
|
+
|
53
59
|
RAWLOG_ERROR1("Unknown Rho::System property : %s", szPropName);
|
54
60
|
|
55
61
|
return rho_ruby_get_NIL();
|
@@ -339,6 +339,18 @@ int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
|
|
339
339
|
return 1;
|
340
340
|
}
|
341
341
|
|
342
|
+
if (strcasecmp("is_emulator",szPropName) == 0)
|
343
|
+
{
|
344
|
+
bool bEmulator = false;
|
345
|
+
#ifdef OS_WINDOWS
|
346
|
+
bEmulator = true;
|
347
|
+
#else
|
348
|
+
|
349
|
+
#endif
|
350
|
+
*resValue = rho_ruby_create_boolean(bEmulator?1:0);
|
351
|
+
return 1;
|
352
|
+
}
|
353
|
+
|
342
354
|
return 0;
|
343
355
|
}
|
344
356
|
|
data/rhodes.gemspec
CHANGED
@@ -20,7 +20,7 @@ class SpecRunner < MSpecScript
|
|
20
20
|
|
21
21
|
config[:files] << "spec/contacts_spec" unless System.get_property('device_name') == 'Win32'
|
22
22
|
# Disable events specs on Android because emulator doesn't contain Calendar provider
|
23
|
-
config[:files] << "spec/events_spec" unless System.get_property('device_name') == 'Win32' or System.get_property('platform') == 'ANDROID'
|
23
|
+
config[:files] << "spec/events_spec" unless System.get_property('device_name') == 'Win32' or (System.get_property('platform') == 'ANDROID' and System.get_property('is_emulator'))
|
24
24
|
|
25
25
|
config[:files] << "spec/barcode_spec" unless System.get_property('device_name') == 'Win32'
|
26
26
|
config[:files] << "spec/mapview_spec" unless System.get_property('platform') == 'WINDOWS'
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 62196425
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
|
9
|
+
- 1
|
10
|
+
- beta
|
11
|
+
- 1
|
12
|
+
version: 2.2.1.beta.1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Rhomobile
|
@@ -15,7 +17,7 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2010-10-
|
20
|
+
date: 2010-10-18 00:00:00 -07:00
|
19
21
|
default_executable:
|
20
22
|
dependencies:
|
21
23
|
- !ruby/object:Gem::Dependency
|