rhodes 3.0.0.beta.5 → 3.0.0.beta.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/framework/rho/rho.rb +2 -1
- data/platform/android/Rhodes/AndroidManifest.xml +2 -1
- data/platform/android/Rhodes/jni/src/callbacks.cpp +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +17 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +126 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +119 -24
- data/platform/iphone/Classes/AppManager/AppManager.m +5 -0
- data/platform/shared/ruby/ext/system/system.i +4 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +21 -5
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +5 -0
- data/rhodes.gemspec +1 -1
- metadata +3 -3
data/lib/framework/rho/rho.rb
CHANGED
@@ -190,8 +190,9 @@ if defined?( RHODES_EMULATOR )
|
|
190
190
|
end
|
191
191
|
else
|
192
192
|
def load_models_from_file(app_manifest_filename=nil)
|
193
|
+
if defined? RHO_WP7
|
193
194
|
return unless Rho::file_exist?(app_manifest_filename)
|
194
|
-
|
195
|
+
end
|
195
196
|
f = File.open(app_manifest_filename)
|
196
197
|
_load_models_from_file(f)
|
197
198
|
f.close
|
@@ -17,7 +17,8 @@
|
|
17
17
|
<activity
|
18
18
|
android:name="com.rhomobile.rhodes.RhodesActivity"
|
19
19
|
android:label="@string/app_name"
|
20
|
-
android:configChanges="orientation|keyboardHidden"
|
20
|
+
android:configChanges="orientation|keyboardHidden"
|
21
|
+
android:launchMode="singleTask">
|
21
22
|
<intent-filter>
|
22
23
|
<action android:name="android.intent.action.MAIN" />
|
23
24
|
<category android:name="android.intent.category.LAUNCHER" />
|
@@ -189,6 +189,16 @@ RHO_GLOBAL void rho_sys_run_app(const char *appname, VALUE params)
|
|
189
189
|
env->CallStaticVoidMethod(cls, mid, rho_cast<jhstring>(appname).get(), jParams);
|
190
190
|
}
|
191
191
|
|
192
|
+
RHO_GLOBAL void rho_sys_bring_to_front()
|
193
|
+
{
|
194
|
+
JNIEnv *env = jnienv();
|
195
|
+
jclass cls = getJNIClass(RHODES_JAVA_CLASS_RHODES_SERVICE);
|
196
|
+
if (!cls) return;
|
197
|
+
jmethodID mid = getJNIClassStaticMethod(env, cls, "bringToFront", "()V");
|
198
|
+
if (!mid) return;
|
199
|
+
env->CallStaticVoidMethod(cls, mid);
|
200
|
+
}
|
201
|
+
|
192
202
|
RHO_GLOBAL void rho_sys_open_url(const char *url)
|
193
203
|
{
|
194
204
|
JNIEnv *env = jnienv();
|
@@ -42,7 +42,7 @@ public class RhodesActivity extends BaseActivity {
|
|
42
42
|
static final String RHO_START_PARAMS_KEY = "RhoStartParams";
|
43
43
|
static final String RHO_URL_START_KEY = "RhoUrlStart";
|
44
44
|
|
45
|
-
private static RhodesActivity sInstance;
|
45
|
+
private static RhodesActivity sInstance = null;
|
46
46
|
|
47
47
|
private Handler mHandler;
|
48
48
|
|
@@ -92,8 +92,11 @@ public class RhodesActivity extends BaseActivity {
|
|
92
92
|
mHandler.post(mSetup);
|
93
93
|
|
94
94
|
sInstance = this;
|
95
|
+
|
96
|
+
Log.i(TAG, ">>>>>>>>>>>>>>> onCreate()");
|
95
97
|
|
96
98
|
notifyUiCreated();
|
99
|
+
RhodesApplication.stateChanged(RhodesApplication.UiState.MainActivityCreated);
|
97
100
|
}
|
98
101
|
|
99
102
|
private void notifyUiCreated() {
|
@@ -136,15 +139,27 @@ public class RhodesActivity extends BaseActivity {
|
|
136
139
|
, false);
|
137
140
|
}
|
138
141
|
|
142
|
+
@Override
|
143
|
+
protected void onNewIntent(Intent intent) {
|
144
|
+
super.onNewIntent(intent);
|
145
|
+
Log.i(TAG, ">>>>>>>>>>>>>>> onNewIntent()");
|
146
|
+
}
|
147
|
+
|
139
148
|
@Override
|
140
149
|
public void onStart() {
|
141
150
|
super.onStart();
|
142
151
|
RhodesService.rhodesActivityStarted(true);
|
143
|
-
|
152
|
+
|
153
|
+
Log.i(TAG, ">>>>>>>>>>>>>>> onStart()");
|
154
|
+
|
155
|
+
RhodesApplication.stateChanged(RhodesApplication.UiState.MainActivityStarted);
|
156
|
+
}
|
144
157
|
|
145
158
|
@Override
|
146
159
|
public void onPause()
|
147
160
|
{
|
161
|
+
RhodesApplication.stateChanged(RhodesApplication.UiState.MainActivityPaused);
|
162
|
+
|
148
163
|
RhodesService.rhodesActivityStarted(false);
|
149
164
|
|
150
165
|
super.onPause();
|
@@ -1,12 +1,14 @@
|
|
1
1
|
package com.rhomobile.rhodes;
|
2
2
|
|
3
|
+
import java.util.Vector;
|
4
|
+
|
3
5
|
import android.app.Application;
|
4
6
|
import android.os.Handler;
|
5
7
|
import android.os.Process;
|
6
8
|
|
7
9
|
public class RhodesApplication extends Application{
|
8
10
|
|
9
|
-
|
11
|
+
private static final String TAG = RhodesApplication.class.getSimpleName();
|
10
12
|
private static Handler mHandler;
|
11
13
|
static {
|
12
14
|
NativeLibraries.load();
|
@@ -25,6 +27,7 @@ public class RhodesApplication extends Application{
|
|
25
27
|
public static void start()
|
26
28
|
{
|
27
29
|
startRhodesApp();
|
30
|
+
stateChanged(AppState.AppStarted);
|
28
31
|
}
|
29
32
|
|
30
33
|
public static boolean canStart(String strCmdLine)
|
@@ -48,5 +51,127 @@ public class RhodesApplication extends Application{
|
|
48
51
|
}, 500);
|
49
52
|
}
|
50
53
|
|
54
|
+
public interface StateHandler
|
55
|
+
{
|
56
|
+
boolean run();
|
57
|
+
}
|
58
|
+
|
59
|
+
enum AppState
|
60
|
+
{
|
61
|
+
Undefined("Undefined") {
|
62
|
+
@Override
|
63
|
+
public boolean canHandle(AppState state) { return false; }
|
64
|
+
},
|
65
|
+
AppStarted("AppStarted") {
|
66
|
+
@Override
|
67
|
+
public boolean canHandle(AppState state) { return state == this; }
|
68
|
+
},
|
69
|
+
AppActivated("AppActivated") {
|
70
|
+
@Override
|
71
|
+
public boolean canHandle(AppState state) { return (state == this) || (state == AppStarted); }
|
72
|
+
},
|
73
|
+
AppDeactivated("AppDEactivated") {
|
74
|
+
@Override
|
75
|
+
public boolean canHandle(AppState state) { return (state == this) || (state == AppStarted); }
|
76
|
+
};
|
77
|
+
|
78
|
+
private Vector<StateHandler> mHandlers = new Vector<StateHandler>();
|
79
|
+
private String TAG;
|
80
|
+
|
81
|
+
private AppState(String tag) { TAG = tag; }
|
82
|
+
|
83
|
+
private synchronized void handle()
|
84
|
+
{
|
85
|
+
Logger.T(TAG, "Running AppState handlers: " + TAG);
|
86
|
+
Vector<StateHandler> doneHandlers = new Vector<StateHandler>();
|
87
|
+
for (StateHandler handler: mHandlers) {
|
88
|
+
if (handler.run()) {
|
89
|
+
doneHandlers.add(handler);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
mHandlers.removeAll(doneHandlers);
|
93
|
+
}
|
94
|
+
|
95
|
+
public synchronized void addHandler(StateHandler handler) { mHandlers.add(handler); }
|
96
|
+
public abstract boolean canHandle(AppState state);
|
97
|
+
|
98
|
+
static public void handleState(AppState state) { state.handle(); }
|
99
|
+
}
|
100
|
+
|
101
|
+
enum UiState
|
102
|
+
{
|
103
|
+
Undefined("Undefined") {
|
104
|
+
@Override
|
105
|
+
public boolean canHandle(UiState state) { return false; }
|
106
|
+
},
|
107
|
+
MainActivityCreated("MainActivityCreated") {
|
108
|
+
@Override
|
109
|
+
public boolean canHandle(UiState state) { return state == this; }
|
110
|
+
},
|
111
|
+
MainActivityStarted("MainActivityStarted") {
|
112
|
+
@Override
|
113
|
+
public boolean canHandle(UiState state) { return (state == this) || (state == MainActivityCreated); }
|
114
|
+
},
|
115
|
+
MainActivityPaused("MainActivityPaused") {
|
116
|
+
@Override
|
117
|
+
public boolean canHandle(UiState state) { return (state == this) || (state == MainActivityCreated); }
|
118
|
+
};
|
119
|
+
|
120
|
+
private Vector<StateHandler> mHandlers = new Vector<StateHandler>();
|
121
|
+
public String TAG;
|
122
|
+
|
123
|
+
private UiState(String tag) { TAG = tag; }
|
124
|
+
|
125
|
+
private synchronized void handle()
|
126
|
+
{
|
127
|
+
Logger.T(TAG, "Running AppState handlers: " + TAG);
|
128
|
+
Vector<StateHandler> doneHandlers = new Vector<StateHandler>();
|
129
|
+
for (StateHandler handler: mHandlers) {
|
130
|
+
if (handler.run()) {
|
131
|
+
doneHandlers.add(handler);
|
132
|
+
}
|
133
|
+
}
|
134
|
+
mHandlers.removeAll(doneHandlers);
|
135
|
+
}
|
136
|
+
|
137
|
+
public synchronized void addHandler(StateHandler handler) { mHandlers.add(handler); }
|
138
|
+
public abstract boolean canHandle(UiState state);
|
139
|
+
|
140
|
+
static public void handleState(UiState state) { state.handle(); }
|
141
|
+
}
|
142
|
+
|
143
|
+
private static AppState sAppState = AppState.Undefined;
|
144
|
+
private static UiState sUiState = UiState.Undefined;
|
145
|
+
|
146
|
+
public static void runWhen(AppState state, StateHandler handler) {
|
147
|
+
if (sAppState.canHandle(state)) {
|
148
|
+
Logger.T(TAG, "Running AppState handler immediately: " + state.TAG);
|
149
|
+
if (handler.run())
|
150
|
+
return;
|
151
|
+
}
|
152
|
+
state.addHandler(handler);
|
153
|
+
Logger.T(TAG, "AppState handler added: " + state.TAG);
|
154
|
+
}
|
155
|
+
|
156
|
+
public static void runWhen(UiState state, StateHandler handler) {
|
157
|
+
if (sUiState.canHandle(state)) {
|
158
|
+
Logger.T(TAG, "Running UiState handler immediately: " + state.TAG);
|
159
|
+
if (handler.run())
|
160
|
+
return;
|
161
|
+
}
|
162
|
+
state.addHandler(handler);
|
163
|
+
Logger.T(TAG, "UiState handler added: " + state.TAG);
|
164
|
+
}
|
165
|
+
|
166
|
+
public static void stateChanged(AppState state)
|
167
|
+
{
|
168
|
+
sAppState = state;
|
169
|
+
AppState.handleState(state);
|
170
|
+
}
|
171
|
+
public static void stateChanged(UiState state)
|
172
|
+
{
|
173
|
+
sUiState = state;
|
174
|
+
UiState.handleState(state);
|
175
|
+
}
|
51
176
|
|
52
177
|
}
|
@@ -40,6 +40,7 @@ import android.app.NotificationManager;
|
|
40
40
|
import android.app.PendingIntent;
|
41
41
|
import android.app.Service;
|
42
42
|
import android.content.BroadcastReceiver;
|
43
|
+
import android.content.ComponentName;
|
43
44
|
import android.content.Context;
|
44
45
|
import android.content.DialogInterface;
|
45
46
|
import android.content.Intent;
|
@@ -55,6 +56,7 @@ import android.net.Uri;
|
|
55
56
|
import android.os.Binder;
|
56
57
|
import android.os.Build;
|
57
58
|
import android.os.Bundle;
|
59
|
+
import android.os.Handler;
|
58
60
|
import android.os.IBinder;
|
59
61
|
import android.os.PowerManager;
|
60
62
|
import android.telephony.TelephonyManager;
|
@@ -85,7 +87,7 @@ public class RhodesService extends Service {
|
|
85
87
|
private static final String ACTION_ASK_CANCEL_DOWNLOAD = "com.rhomobile.rhodes.DownloadManager.ACTION_ASK_CANCEL_DOWNLOAD";
|
86
88
|
private static final String ACTION_CANCEL_DOWNLOAD = "com.rhomobile.rhodes.DownloadManager.ACTION_CANCEL_DOWNLOAD";
|
87
89
|
|
88
|
-
private static RhodesService sInstance;
|
90
|
+
private static RhodesService sInstance = null;
|
89
91
|
|
90
92
|
private final IBinder mBinder = new LocalBinder();
|
91
93
|
|
@@ -102,8 +104,6 @@ public class RhodesService extends Service {
|
|
102
104
|
|
103
105
|
private NotificationManager mNM;
|
104
106
|
|
105
|
-
//private MainView mMainView;
|
106
|
-
|
107
107
|
private static int mScreenWidth;
|
108
108
|
private static int mScreenHeight;
|
109
109
|
private static int mScreenOrientation;
|
@@ -117,7 +117,9 @@ public class RhodesService extends Service {
|
|
117
117
|
private static boolean sRhodesActivityStarted = false;
|
118
118
|
|
119
119
|
synchronized
|
120
|
-
static void rhodesActivityStarted(boolean started) {
|
120
|
+
static void rhodesActivityStarted(boolean started) {
|
121
|
+
sRhodesActivityStarted = started;
|
122
|
+
}
|
121
123
|
|
122
124
|
synchronized
|
123
125
|
public static boolean isRhodesActivityStarted() { return sRhodesActivityStarted; }
|
@@ -210,6 +212,8 @@ public class RhodesService extends Service {
|
|
210
212
|
return false;
|
211
213
|
}
|
212
214
|
|
215
|
+
Handler mHandler = null;
|
216
|
+
|
213
217
|
private native void initClassLoader(ClassLoader c);
|
214
218
|
|
215
219
|
public native void doSyncAllSources(boolean v);
|
@@ -404,7 +408,7 @@ public class RhodesService extends Service {
|
|
404
408
|
}
|
405
409
|
|
406
410
|
RhodesApplication.start();
|
407
|
-
|
411
|
+
|
408
412
|
if (sActivitiesActive > 0)
|
409
413
|
handleAppActivation();
|
410
414
|
}
|
@@ -493,9 +497,18 @@ public class RhodesService extends Service {
|
|
493
497
|
setPushRegistrationId(id);
|
494
498
|
break;
|
495
499
|
case PushReceiver.INTENT_TYPE_MESSAGE:
|
496
|
-
Bundle extras = intent.getBundleExtra(PushReceiver.INTENT_EXTRAS);
|
500
|
+
final Bundle extras = intent.getBundleExtra(PushReceiver.INTENT_EXTRAS);
|
497
501
|
Logger.D(TAG, "Received PUSH message: " + extras);
|
498
|
-
|
502
|
+
RhodesApplication.runWhen(
|
503
|
+
RhodesApplication.AppState.AppStarted,
|
504
|
+
new RhodesApplication.StateHandler() {
|
505
|
+
@Override
|
506
|
+
public boolean run()
|
507
|
+
{
|
508
|
+
handlePushMessage(extras);
|
509
|
+
return true;
|
510
|
+
}
|
511
|
+
});
|
499
512
|
break;
|
500
513
|
default:
|
501
514
|
Logger.W(TAG, "Unknown command type received from " + source + ": " + type);
|
@@ -1166,18 +1179,36 @@ public class RhodesService extends Service {
|
|
1166
1179
|
|
1167
1180
|
String data = builder.toString();
|
1168
1181
|
Logger.D(TAG, "Received PUSH message: " + data);
|
1169
|
-
if (callPushCallback(data))
|
1170
|
-
|
1182
|
+
if (callPushCallback(data)) {
|
1183
|
+
Logger.T(TAG, "Push message completely handled in callback");
|
1184
|
+
return;
|
1185
|
+
}
|
1171
1186
|
|
1172
|
-
String alert = extras.getString("alert");
|
1187
|
+
final String alert = extras.getString("alert");
|
1173
1188
|
if (alert != null) {
|
1174
1189
|
Logger.D(TAG, "PUSH: Alert: " + alert);
|
1175
|
-
|
1190
|
+
RhodesApplication.runWhen(
|
1191
|
+
RhodesApplication.UiState.MainActivityStarted,
|
1192
|
+
new RhodesApplication.StateHandler() {
|
1193
|
+
@Override
|
1194
|
+
public boolean run() {
|
1195
|
+
Alert.showPopup(alert);
|
1196
|
+
return true;
|
1197
|
+
}
|
1198
|
+
});
|
1176
1199
|
}
|
1177
|
-
String sound = extras.getString("sound");
|
1200
|
+
final String sound = extras.getString("sound");
|
1178
1201
|
if (sound != null) {
|
1179
1202
|
Logger.D(TAG, "PUSH: Sound file name: " + sound);
|
1180
|
-
|
1203
|
+
RhodesApplication.runWhen(
|
1204
|
+
RhodesApplication.UiState.MainActivityStarted,
|
1205
|
+
new RhodesApplication.StateHandler() {
|
1206
|
+
@Override
|
1207
|
+
public boolean run() {
|
1208
|
+
Alert.playFile("/public/alerts/" + sound, null);
|
1209
|
+
return true;
|
1210
|
+
}
|
1211
|
+
});
|
1181
1212
|
}
|
1182
1213
|
String vibrate = extras.getString("vibrate");
|
1183
1214
|
if (vibrate != null) {
|
@@ -1189,8 +1220,17 @@ public class RhodesService extends Service {
|
|
1189
1220
|
catch (NumberFormatException e) {
|
1190
1221
|
duration = 5;
|
1191
1222
|
}
|
1223
|
+
final int arg_duration = duration;
|
1192
1224
|
Logger.D(TAG, "Vibrate " + duration + " seconds");
|
1193
|
-
|
1225
|
+
RhodesApplication.runWhen(
|
1226
|
+
RhodesApplication.UiState.MainActivityStarted,
|
1227
|
+
new RhodesApplication.StateHandler() {
|
1228
|
+
@Override
|
1229
|
+
public boolean run() {
|
1230
|
+
Alert.vibrate(arg_duration);
|
1231
|
+
return true;
|
1232
|
+
}
|
1233
|
+
});
|
1194
1234
|
}
|
1195
1235
|
|
1196
1236
|
String syncSources = extras.getString("do_sync");
|
@@ -1199,15 +1239,34 @@ public class RhodesService extends Service {
|
|
1199
1239
|
boolean syncAll = false;
|
1200
1240
|
for (String source : syncSources.split(",")) {
|
1201
1241
|
Logger.D(TAG, "url = " + source);
|
1202
|
-
if (source.equalsIgnoreCase("all"))
|
1242
|
+
if (source.equalsIgnoreCase("all")) {
|
1203
1243
|
syncAll = true;
|
1204
|
-
|
1205
|
-
|
1244
|
+
break;
|
1245
|
+
} else {
|
1246
|
+
final String arg_source = source.trim();
|
1247
|
+
RhodesApplication.runWhen(
|
1248
|
+
RhodesApplication.AppState.AppActivated,
|
1249
|
+
new RhodesApplication.StateHandler() {
|
1250
|
+
@Override
|
1251
|
+
public boolean run() {
|
1252
|
+
doSyncSource(arg_source);
|
1253
|
+
return true;
|
1254
|
+
}
|
1255
|
+
});
|
1206
1256
|
}
|
1207
1257
|
}
|
1208
1258
|
|
1209
|
-
if (syncAll)
|
1210
|
-
|
1259
|
+
if (syncAll) {
|
1260
|
+
RhodesApplication.runWhen(
|
1261
|
+
RhodesApplication.AppState.AppActivated,
|
1262
|
+
new RhodesApplication.StateHandler() {
|
1263
|
+
@Override
|
1264
|
+
public boolean run() {
|
1265
|
+
doSyncAllSources(true);
|
1266
|
+
return true;
|
1267
|
+
}
|
1268
|
+
});
|
1269
|
+
}
|
1211
1270
|
}
|
1212
1271
|
}
|
1213
1272
|
|
@@ -1262,11 +1321,13 @@ public class RhodesService extends Service {
|
|
1262
1321
|
restartGeoLocationIfNeeded();
|
1263
1322
|
restoreWakeLockIfNeeded();
|
1264
1323
|
callActivationCallback(true);
|
1324
|
+
RhodesApplication.stateChanged(RhodesApplication.AppState.AppActivated);
|
1265
1325
|
}
|
1266
1326
|
|
1267
1327
|
private void handleAppDeactivation() {
|
1268
1328
|
if (DEBUG)
|
1269
1329
|
Log.d(TAG, "handle app deactivation");
|
1330
|
+
RhodesApplication.stateChanged(RhodesApplication.AppState.AppDeactivated);
|
1270
1331
|
stopWakeLock();
|
1271
1332
|
stopGeoLocation();
|
1272
1333
|
callActivationCallback(false);
|
@@ -1304,10 +1365,23 @@ public class RhodesService extends Service {
|
|
1304
1365
|
|
1305
1366
|
@Override
|
1306
1367
|
public void startActivity(Intent intent) {
|
1307
|
-
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1368
|
+
|
1369
|
+
RhodesActivity ra = RhodesActivity.getInstance();
|
1370
|
+
if(intent.getComponent().compareTo(new ComponentName(this, RhodesActivity.class.getName())) == 0) {
|
1371
|
+
Logger.T(TAG, "Start or bring main activity: " + RhodesActivity.class.getName() + ".");
|
1372
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
1373
|
+
if (ra == null) {
|
1374
|
+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
1375
|
+
super.startActivity(intent);
|
1376
|
+
return;
|
1377
|
+
}
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
if (ra != null) {
|
1381
|
+
ra.startActivity(intent);
|
1382
|
+
} else {
|
1383
|
+
throw new IllegalStateException("Trying to start activity, but there is no main activity instance (we are in background, no UI active)");
|
1384
|
+
}
|
1311
1385
|
}
|
1312
1386
|
|
1313
1387
|
public static Context getContext() {
|
@@ -1320,5 +1394,26 @@ public class RhodesService extends Service {
|
|
1320
1394
|
public static boolean isJQTouch_mode() {
|
1321
1395
|
return RhoConf.getBool("jqtouch_mode");
|
1322
1396
|
}
|
1323
|
-
|
1397
|
+
|
1398
|
+
public static void bringToFront() {
|
1399
|
+
if (isRhodesActivityStarted()) {
|
1400
|
+
Logger.T(TAG, "Main activity is already at front, do nothing");
|
1401
|
+
return;
|
1402
|
+
}
|
1403
|
+
|
1404
|
+
RhodesService srv = RhodesService.getInstance();
|
1405
|
+
if (srv == null)
|
1406
|
+
throw new IllegalStateException("No rhodes service instance at this moment");
|
1407
|
+
|
1408
|
+
Logger.T(TAG, "Bring main activity to front");
|
1409
|
+
if (RhodesActivity.getInstance() != null)
|
1410
|
+
Logger.T(TAG, "There is main activity, should bring to front");
|
1411
|
+
else
|
1412
|
+
Logger.T(TAG, "There is no main activity, should start new one");
|
1413
|
+
|
1414
|
+
Intent intent = new Intent(srv, RhodesActivity.class);
|
1415
|
+
// intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
1416
|
+
srv.startActivity(intent);
|
1417
|
+
}
|
1418
|
+
|
1324
1419
|
}
|
@@ -474,6 +474,11 @@ void rho_sys_run_app(const char* appname, VALUE params)
|
|
474
474
|
RAWLOG_INFO("rho_sys_run_app failed.");
|
475
475
|
}
|
476
476
|
|
477
|
+
void rho_sys_bring_to_front()
|
478
|
+
{
|
479
|
+
RAWLOG_INFO("rho_sys_bring_to_front has no implementation on iPhone.");
|
480
|
+
}
|
481
|
+
|
477
482
|
|
478
483
|
extern VALUE rho_sys_has_network();
|
479
484
|
|
@@ -36,6 +36,9 @@ extern int rho_sys_set_sleeping(int sleeping);
|
|
36
36
|
#define run_app rho_sys_run_app
|
37
37
|
extern void rho_sys_run_app(const char* appname, VALUE params);
|
38
38
|
|
39
|
+
#define bring_to_front rho_sys_bring_to_front
|
40
|
+
extern void rho_sys_bring_to_front();
|
41
|
+
|
39
42
|
#define get_start_params rho_sys_get_start_params
|
40
43
|
extern const char* rho_sys_get_start_params();
|
41
44
|
|
@@ -101,6 +104,7 @@ extern void exit();
|
|
101
104
|
extern void unzip_file( const char *path );
|
102
105
|
extern int set_sleeping( bool sleeping );
|
103
106
|
extern void run_app(const char *appname, VALUE params);
|
107
|
+
extern void bring_to_front();
|
104
108
|
extern const char* get_start_params();
|
105
109
|
extern void open_url(const char *url);
|
106
110
|
%predicate app_installed(const char *appname);
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 2.0.
|
3
|
+
* Version 2.0.1
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -281,7 +281,7 @@
|
|
281
281
|
/*
|
282
282
|
Flags/methods for returning states.
|
283
283
|
|
284
|
-
The SWIG conversion methods, as ConvertPtr, return
|
284
|
+
The SWIG conversion methods, as ConvertPtr, return an integer
|
285
285
|
that tells if the conversion was successful or not. And if not,
|
286
286
|
an error code can be returned (see swigerrors.swg for the codes).
|
287
287
|
|
@@ -998,7 +998,7 @@ static VALUE _mSWIG = Qnil;
|
|
998
998
|
|
999
999
|
/* Define custom exceptions for errors that do not map to existing Ruby
|
1000
1000
|
exceptions. Note this only works for C++ since a global cannot be
|
1001
|
-
initialized by a
|
1001
|
+
initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
|
1002
1002
|
|
1003
1003
|
SWIGINTERN VALUE
|
1004
1004
|
getNullReferenceError(void) {
|
@@ -1807,7 +1807,7 @@ static VALUE mSystem;
|
|
1807
1807
|
#define SWIG_RUBY_THREAD_END_BLOCK
|
1808
1808
|
|
1809
1809
|
|
1810
|
-
#define SWIGVERSION
|
1810
|
+
#define SWIGVERSION 0x020001
|
1811
1811
|
#define SWIG_VERSION SWIGVERSION
|
1812
1812
|
|
1813
1813
|
|
@@ -1850,6 +1850,9 @@ extern int rho_sys_set_sleeping(int sleeping);
|
|
1850
1850
|
#define run_app rho_sys_run_app
|
1851
1851
|
extern void rho_sys_run_app(const char* appname, VALUE params);
|
1852
1852
|
|
1853
|
+
#define bring_to_front rho_sys_bring_to_front
|
1854
|
+
extern void rho_sys_bring_to_front();
|
1855
|
+
|
1853
1856
|
#define get_start_params rho_sys_get_start_params
|
1854
1857
|
extern const char* rho_sys_get_start_params();
|
1855
1858
|
|
@@ -1950,7 +1953,7 @@ SWIG_ruby_failed(void)
|
|
1950
1953
|
}
|
1951
1954
|
|
1952
1955
|
|
1953
|
-
/*@SWIG
|
1956
|
+
/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
|
1954
1957
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
1955
1958
|
{
|
1956
1959
|
VALUE obj = args[0];
|
@@ -2356,6 +2359,18 @@ fail:
|
|
2356
2359
|
}
|
2357
2360
|
|
2358
2361
|
|
2362
|
+
SWIGINTERN VALUE
|
2363
|
+
_wrap_bring_to_front(int argc, VALUE *argv, VALUE self) {
|
2364
|
+
if ((argc < 0) || (argc > 0)) {
|
2365
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2366
|
+
}
|
2367
|
+
bring_to_front();
|
2368
|
+
return Qnil;
|
2369
|
+
fail:
|
2370
|
+
return Qnil;
|
2371
|
+
}
|
2372
|
+
|
2373
|
+
|
2359
2374
|
SWIGINTERN VALUE
|
2360
2375
|
_wrap_get_start_params(int argc, VALUE *argv, VALUE self) {
|
2361
2376
|
char *result = 0 ;
|
@@ -2827,6 +2842,7 @@ SWIGEXPORT void Init_System(void) {
|
|
2827
2842
|
rb_define_module_function(mSystem, "unzip_file", _wrap_unzip_file, -1);
|
2828
2843
|
rb_define_module_function(mSystem, "set_sleeping", _wrap_set_sleeping, -1);
|
2829
2844
|
rb_define_module_function(mSystem, "run_app", _wrap_run_app, -1);
|
2845
|
+
rb_define_module_function(mSystem, "bring_to_front", _wrap_bring_to_front, -1);
|
2830
2846
|
rb_define_module_function(mSystem, "get_start_params", _wrap_get_start_params, -1);
|
2831
2847
|
rb_define_module_function(mSystem, "open_url", _wrap_open_url, -1);
|
2832
2848
|
rb_define_module_function(mSystem, "app_installed?", _wrap_app_installedq___, -1);
|
@@ -635,6 +635,11 @@ void rho_sys_run_app(const char *appname, VALUE params)
|
|
635
635
|
|
636
636
|
}
|
637
637
|
|
638
|
+
void rho_sys_bring_to_front()
|
639
|
+
{
|
640
|
+
LOG(INFO) + "rho_sys_bring_to_front() has no implementation on Win Mobile.";
|
641
|
+
}
|
642
|
+
|
638
643
|
int rho_sys_is_app_installed(const char *appname)
|
639
644
|
{
|
640
645
|
int nRet = 0;
|
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.0.0.beta.
|
6
|
+
s.version = "3.0.0.beta.6"
|
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: 62196431
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- beta
|
11
|
-
-
|
12
|
-
version: 3.0.0.beta.
|
11
|
+
- 6
|
12
|
+
version: 3.0.0.beta.6
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Rhomobile
|