rhodes 2.2.4.beta.1 → 2.2.5.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/Rakefile +119 -3
- data/lib/build/jake.rb +15 -1
- data/lib/framework/dateME.rb +6 -1
- data/lib/framework/rho/render.rb +18 -15
- data/lib/framework/rho/rho.rb +105 -43
- data/lib/framework/rho/rhoapplication.rb +1 -1
- data/lib/framework/rho/rhocontact.rb +41 -13
- data/lib/framework/rho/rhocontroller.rb +10 -1
- data/lib/framework/rho/rhoevent_c.rb +6 -1
- data/lib/framework/rho/rhosupport.rb +1 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rholang/rhomsg_de.rb +1 -1
- data/lib/framework/rholang/rhomsg_es.rb +1 -1
- data/lib/framework/rholang/rhomsg_it.rb +28 -0
- data/lib/framework/rhom/rhom.rb +6 -0
- data/lib/framework/rhom/rhom_model.rb +14 -7
- data/lib/framework/rhom/rhom_object_factory.rb +121 -56
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.full.xml +62 -0
- data/platform/android/Rhodes/AndroidManifest.xml +3 -34
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +17 -2
- data/platform/android/Rhodes/jni/src/alert.cpp +16 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +27 -3
- data/platform/android/Rhodes/jni/src/nativebar.cpp +3 -0
- data/platform/android/Rhodes/jni/src/nativeview.cpp +131 -1
- data/platform/android/Rhodes/jni/src/phonebook.cpp +102 -41
- data/platform/android/Rhodes/jni/src/rhodes.cpp +113 -32
- data/platform/android/Rhodes/jni/src/ringtones.cpp +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +9 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +184 -49
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +49 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +104 -57
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +36 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +24 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +7 -8
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +185 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +54 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +107 -14
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +72 -24
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +22 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +91 -11
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +10 -0
- data/platform/android/build/android.rake +50 -9
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +3 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/SchemaManager.java +3 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +7 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +2 -2
- data/platform/bb/RubyVM/RubyVM.jdp +1 -0
- data/platform/bb/RubyVM/src/com/rho/AppBuildConfig.java +22 -0
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +5 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +1 -1
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +51 -4
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +21 -10
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +82 -33
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +59 -6
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyFloat_Methods.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/GeneratedMethods/RubyString_Methods.java +19 -7
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/ArrayPacker.java +1 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyFloat.java +5 -0
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyString.java +55 -11
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +18 -2
- data/platform/bb/RubyVM/src/com/xruby/runtime/lang/RubyKernelModule.java +8 -5
- data/platform/bb/RubyVM/src/j2me/lang/CharacterMe.java +1 -1
- data/platform/bb/RubyVM/src/j2me/util/StringParser.java +2 -0
- data/platform/bb/build/RubyVM_build.files +1 -0
- data/platform/bb/build/bb.rake +21 -2
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +3 -3
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +1 -1
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +1 -2
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +15 -16
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +4 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +58 -0
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +90 -4
- data/platform/iphone/Classes/AppManager/AppManager.m +43 -5
- data/platform/iphone/Classes/Event/Event.h +2 -0
- data/platform/iphone/Classes/Event/Event.m +12 -1
- data/platform/iphone/Classes/GeoLocation/LocationController.m +9 -3
- data/platform/iphone/Classes/MapView/MapViewController.m +20 -9
- data/platform/iphone/Classes/NativeBar.m +27 -0
- data/platform/iphone/Classes/Phonebook/phonebook.m +17 -0
- data/platform/iphone/Classes/RhoAlert.m +61 -1
- data/platform/iphone/Classes/RhoMainView.h +1 -0
- data/platform/iphone/Classes/Rhodes.h +2 -0
- data/platform/iphone/Classes/Rhodes.m +108 -1
- data/platform/iphone/Classes/SimpleMainView.h +4 -0
- data/platform/iphone/Classes/SimpleMainView.m +30 -3
- data/platform/iphone/Classes/SplashViewController.m +3 -1
- data/platform/iphone/Classes/TabbedMainView.h +2 -0
- data/platform/iphone/Classes/TabbedMainView.m +63 -11
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +26 -0
- data/platform/iphone/Info.plist +12 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +8 -0
- data/platform/iphone/rbuild/iphone.rake +181 -25
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +5 -5
- data/platform/shared/common/IRhoThreadImpl.h +1 -1
- data/platform/shared/common/PosixThreadImpl.cpp +5 -3
- data/platform/shared/common/PosixThreadImpl.h +1 -1
- data/platform/shared/common/RhoFilePath.h +11 -0
- data/platform/shared/common/RhoNativeViewManager.h +17 -0
- data/platform/shared/common/RhoThread.h +1 -1
- data/platform/shared/common/RhodesApp.cpp +29 -8
- data/platform/shared/common/ThreadQueue.cpp +5 -3
- data/platform/shared/common/ThreadQueue.h +2 -1
- data/platform/shared/common/app_build_configs.c +25 -0
- data/platform/shared/common/app_build_configs.h +11 -0
- data/platform/shared/net/AsyncHttp.cpp +5 -5
- data/platform/shared/net/CURLNetRequest.cpp +25 -7
- data/platform/shared/net/CURLNetRequest.h +2 -1
- data/platform/shared/net/HttpServer.cpp +28 -0
- data/platform/shared/ruby/ext/nativebar/nativebar.i +3 -0
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +26 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +6 -0
- data/platform/shared/ruby/ext/rho/rhoruby.h +1 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +15 -2
- data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -2
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +97 -2
- data/platform/shared/ruby/ext/system/system.i +13 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +104 -1
- data/platform/shared/rubyext/RhoAppAdapter.cpp +7 -0
- data/platform/shared/sync/SyncEngine.cpp +43 -3
- data/platform/shared/sync/SyncEngine.h +13 -0
- data/platform/shared/sync/SyncNotify.cpp +41 -23
- data/platform/shared/sync/SyncNotify.h +18 -4
- data/platform/shared/sync/SyncSource.cpp +52 -14
- data/platform/shared/sync/SyncSource.h +1 -0
- data/platform/shared/sync/SyncThread.cpp +29 -9
- data/platform/shared/sync/SyncThread.h +4 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +8 -0
- data/platform/wm/build/build_inf.js +15 -9
- data/platform/wm/build/wm.rake +10 -5
- data/platform/wm/rhodes/Alert.cpp +10 -0
- data/platform/wm/rhodes/Alert.h +3 -3
- data/platform/wm/rhodes/MainWindow.cpp +171 -26
- data/platform/wm/rhodes/MainWindow.h +23 -1
- data/platform/wm/rhodes/MetaHandler.cpp +192 -0
- data/platform/wm/rhodes/MetaHandler.h +31 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +126 -0
- data/platform/wm/rhodes/RhoNativeViewManagerWM.h +20 -0
- data/platform/wm/rhodes/Rhodes.cpp +91 -2
- data/platform/wm/rhodes/Rhodes.rc +15 -6
- data/platform/wm/rhodes/SyncStatusDlg.cpp +32 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +29 -0
- data/platform/wm/rhodes/resource.h +5 -2
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +3 -1
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +146 -14
- data/platform/wm/rhodes/rhodes.vcproj +28 -0
- data/rakefile.rb +119 -3
- data/res/build-tools/iphonesim/README +58 -0
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.h +43 -0
- data/res/build-tools/iphonesim/Source/iPhoneSimulator.m +224 -0
- data/res/build-tools/iphonesim/Source/main.m +52 -0
- data/res/build-tools/iphonesim/Source/nsprintf.h +3 -0
- data/res/build-tools/iphonesim/Source/nsprintf.m +42 -0
- data/res/build-tools/iphonesim/build/Release/iphonesim +0 -0
- data/res/build-tools/iphonesim/iPhoneSimulatorRemoteClient/iPhoneSimulatorRemoteClient.h +124 -0
- data/res/build-tools/iphonesim/iphonesim.xcodeproj/project.pbxproj +261 -0
- data/res/build-tools/iphonesim/iphonesim_Prefix.pch +7 -0
- data/res/generators/rhogen.rb +5 -0
- data/res/generators/templates/application/app/layout.erb +7 -13
- data/res/generators/templates/application/app/loading.png +0 -0
- data/res/generators/templates/application/build.yml +3 -0
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/public/css/iphone.css +96 -0
- data/res/generators/templates/application/public/images/backButton.png +0 -0
- data/res/generators/templates/application/public/jqtouch/jqtouch.js +2 -1
- data/res/generators/templates/application/rhoconfig.txt +2 -0
- data/rhodes.gemspec +1 -1
- data/spec/phone_spec/app/spec/array_pack_spec.rb +108 -0
- data/spec/phone_spec/app/spec/bulksync_spec.rb +1 -0
- data/spec/phone_spec/app/spec/date_spec.rb +27 -0
- data/spec/phone_spec/app/spec/fixtures/classes.rb +91 -0
- data/spec/phone_spec/app/spec/lstrip_spec.rb +57 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +50 -19
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +78 -0
- data/spec/phone_spec/app/spec/rstrip_spec.rb +51 -0
- data/spec/phone_spec/app/spec/strip_spec.rb +50 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +46 -3
- data/spec/phone_spec/app/spec_runner.rb +6 -0
- metadata +34 -4
@@ -134,15 +134,15 @@ void CAsyncHttp::CHttpCommand::execute()
|
|
134
134
|
CRhoParams oItem = arParams.getItem(i);
|
135
135
|
|
136
136
|
net::CMultipartItem* pItem = new net::CMultipartItem();
|
137
|
-
String
|
138
|
-
if (
|
137
|
+
String strFilePath = oItem.getString("filename");
|
138
|
+
if ( strFilePath.length() == 0 )
|
139
139
|
{
|
140
|
-
pItem->m_strBody =
|
141
|
-
pItem->m_strContentType = oItem.getString("content_type", "
|
140
|
+
pItem->m_strBody = oItem.getString("body");
|
141
|
+
pItem->m_strContentType = oItem.getString("content_type", "");
|
142
142
|
}
|
143
143
|
else
|
144
144
|
{
|
145
|
-
pItem->m_strFilePath =
|
145
|
+
pItem->m_strFilePath = strFilePath;
|
146
146
|
pItem->m_strContentType = oItem.getString("content_type", "application/octet-stream");
|
147
147
|
}
|
148
148
|
|
@@ -81,7 +81,7 @@ public:
|
|
81
81
|
|
82
82
|
INetResponse *CURLNetRequest::makeResponse(String strBody, int nErrorCode)
|
83
83
|
{
|
84
|
-
std::auto_ptr<CURLNetResponseImpl> resp(new CURLNetResponseImpl(strBody, nErrorCode));
|
84
|
+
std::auto_ptr<CURLNetResponseImpl> resp(new CURLNetResponseImpl(strBody, nErrorCode>0?nErrorCode:-1));
|
85
85
|
if (resp->isOK())
|
86
86
|
resp->setCookies(makeCookies());
|
87
87
|
return resp.release();
|
@@ -118,6 +118,7 @@ static size_t curlBodyStringCallback(void *ptr, size_t size, size_t nmemb, void
|
|
118
118
|
return nBytes;
|
119
119
|
}
|
120
120
|
|
121
|
+
extern "C" int rho_net_ping_network(const char* szHost);
|
121
122
|
INetResponse* CURLNetRequest::pullData(const String& strUrl, IRhoSession* oSession )
|
122
123
|
{
|
123
124
|
RAWLOG_INFO1("GET url: %s", strUrl.c_str());
|
@@ -144,9 +145,24 @@ INetResponse* CURLNetRequest::doRequest(const char *method, const String& strUrl
|
|
144
145
|
const String& strBody, IRhoSession *oSession,
|
145
146
|
Hashtable<String,String>* pHeaders)
|
146
147
|
{
|
147
|
-
|
148
|
+
INetResponse* pResp = doPull(method, strUrl, strBody, null, oSession, pHeaders);
|
149
|
+
return pResp;
|
148
150
|
}
|
149
151
|
|
152
|
+
CURLcode CURLNetRequest::doCURLPerform(const String& strUrl)
|
153
|
+
{
|
154
|
+
CURLcode err = m_curl.perform();
|
155
|
+
if ( err != CURLE_OK && !net::URI::isLocalHost(strUrl.c_str()) )
|
156
|
+
{
|
157
|
+
long statusCode = 0;
|
158
|
+
curl_easy_getinfo(m_curl.curl(), CURLINFO_RESPONSE_CODE, &statusCode);
|
159
|
+
if ( statusCode == 0 && rho_net_ping_network(strUrl.c_str()) )
|
160
|
+
err = m_curl.perform();
|
161
|
+
}
|
162
|
+
|
163
|
+
return err;
|
164
|
+
}
|
165
|
+
|
150
166
|
INetResponse* CURLNetRequest::doPull(const char* method, const String& strUrl,
|
151
167
|
const String& strBody, common::CRhoFile *oFile,
|
152
168
|
IRhoSession* oSession, Hashtable<String,String>* pHeaders )
|
@@ -157,7 +173,8 @@ INetResponse* CURLNetRequest::doPull(const char* method, const String& strUrl,
|
|
157
173
|
if (oFile)
|
158
174
|
nStartFrom = oFile->size();
|
159
175
|
|
160
|
-
|
176
|
+
if( !net::URI::isLocalHost(strUrl.c_str()) )
|
177
|
+
rho_net_impl_network_indicator(1);
|
161
178
|
|
162
179
|
Hashtable<String,String> h;
|
163
180
|
if (pHeaders)
|
@@ -177,7 +194,7 @@ INetResponse* CURLNetRequest::doPull(const char* method, const String& strUrl,
|
|
177
194
|
if (nStartFrom > 0)
|
178
195
|
curl_easy_setopt(curl, CURLOPT_RESUME_FROM, nStartFrom);
|
179
196
|
|
180
|
-
CURLcode err =
|
197
|
+
CURLcode err = doCURLPerform(strUrl);
|
181
198
|
curl_slist_free_all(hdrs);
|
182
199
|
|
183
200
|
long statusCode = 0;
|
@@ -214,7 +231,8 @@ INetResponse* CURLNetRequest::doPull(const char* method, const String& strUrl,
|
|
214
231
|
break;
|
215
232
|
}
|
216
233
|
|
217
|
-
|
234
|
+
if( !net::URI::isLocalHost(strUrl.c_str()) )
|
235
|
+
rho_net_impl_network_indicator(0);
|
218
236
|
|
219
237
|
return makeResponse(strRespBody, nRespCode);
|
220
238
|
}
|
@@ -295,7 +313,7 @@ INetResponse* CURLNetRequest::pushMultipartData(const String& strUrl, VectorPtr<
|
|
295
313
|
|
296
314
|
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
|
297
315
|
|
298
|
-
CURLcode err =
|
316
|
+
CURLcode err = doCURLPerform(strUrl);
|
299
317
|
|
300
318
|
curl_slist_free_all(hdrs);
|
301
319
|
curl_formfree(post);
|
@@ -347,7 +365,7 @@ INetResponse* CURLNetRequest::pushFile(const String& strUrl, const String& strFi
|
|
347
365
|
CURLFORM_END);
|
348
366
|
curl_easy_setopt(curl, CURLOPT_HTTPPOST, post);
|
349
367
|
|
350
|
-
|
368
|
+
CURLcode err = doCURLPerform(strUrl);
|
351
369
|
|
352
370
|
curl_slist_free_all(hdrs);
|
353
371
|
curl_formfree(post);
|
@@ -72,7 +72,8 @@ private:
|
|
72
72
|
int getResponseCode(CURLcode err, const String& strRespBody, IRhoSession* oSession);
|
73
73
|
String makeCookies();
|
74
74
|
INetResponse *makeResponse(String strBody, int nErrorCode);
|
75
|
-
|
75
|
+
CURLcode doCURLPerform(const String& strUrl);
|
76
|
+
|
76
77
|
CURLHolder m_curl;
|
77
78
|
};
|
78
79
|
|
@@ -6,6 +6,10 @@
|
|
6
6
|
|
7
7
|
#include <algorithm>
|
8
8
|
|
9
|
+
#if !defined(OS_WINDOWS) && !defined(OS_WINCE)
|
10
|
+
#include <arpa/inet.h>
|
11
|
+
#endif
|
12
|
+
|
9
13
|
#if !defined(OS_WINCE)
|
10
14
|
#include <common/stat.h>
|
11
15
|
#else
|
@@ -258,9 +262,31 @@ void CHttpServer::close_listener()
|
|
258
262
|
|
259
263
|
void CHttpServer::stop()
|
260
264
|
{
|
265
|
+
// WARNING!!! It is not enough to just close listener on Android
|
266
|
+
// to stop server. By unknown reason accept does not unblock if
|
267
|
+
// it was closed in another thread. However, on iPhone it works
|
268
|
+
// right. To work around this, we create dummy sockect and connect
|
269
|
+
// to the listener. This surely unblock accept on listener and,
|
270
|
+
// therefore, stop server thread (because m_active set to false).
|
261
271
|
m_active = false;
|
272
|
+
RAWTRACE("Stopping server...");
|
273
|
+
SOCKET conn = socket(AF_INET, SOCK_STREAM, 0);
|
274
|
+
sockaddr_in sa;
|
275
|
+
memset(&sa, 0, sizeof(sa));
|
276
|
+
sa.sin_family = AF_INET;
|
277
|
+
sa.sin_port = htons((uint16_t)m_port);
|
278
|
+
sa.sin_addr.s_addr = inet_addr("127.0.0.1");
|
279
|
+
int err = connect(conn, (struct sockaddr *)&sa, sizeof(sa));
|
280
|
+
if (err == SOCKET_ERROR)
|
281
|
+
RAWLOG_ERROR1("Stopping server: can not connect to listener: %d", RHO_NET_ERROR_CODE);
|
282
|
+
else
|
283
|
+
RAWTRACE("Stopping server: command sent");
|
284
|
+
closesocket(conn);
|
285
|
+
/*
|
262
286
|
RAWTRACE("Close listening socket");
|
263
287
|
close_listener();
|
288
|
+
RAWTRACE("Listening socket closed");
|
289
|
+
*/
|
264
290
|
}
|
265
291
|
|
266
292
|
void CHttpServer::register_uri(String const &uri, CHttpServer::callback_t const &callback)
|
@@ -338,7 +364,9 @@ bool CHttpServer::run()
|
|
338
364
|
for(;;) {
|
339
365
|
RAWTRACE("Waiting for connections...");
|
340
366
|
rho_ruby_start_threadidle();
|
367
|
+
//RAWTRACE("Before accept...");
|
341
368
|
SOCKET conn = accept(m_listener, NULL, NULL);
|
369
|
+
//RAWTRACE("After accept...");
|
342
370
|
rho_ruby_stop_threadidle();
|
343
371
|
if (!m_active) {
|
344
372
|
RAWTRACE("Stop HTTP server");
|
@@ -10,6 +10,8 @@ extern void nativebar_switch_tab(int index);
|
|
10
10
|
#define switch_tab nativebar_switch_tab
|
11
11
|
extern VALUE nativebar_started();
|
12
12
|
#define started nativebar_started
|
13
|
+
extern void nativebar_set_tab_badge(int index,char *val);
|
14
|
+
#define set_tab_badge nativebar_set_tab_badge
|
13
15
|
%}
|
14
16
|
|
15
17
|
%typemap(in) (rho_param *p) {
|
@@ -24,3 +26,4 @@ extern void create(int bar_type, rho_param *p);
|
|
24
26
|
extern void remove();
|
25
27
|
extern void switch_tab(int index);
|
26
28
|
extern VALUE started();
|
29
|
+
extern void set_tab_badge(int index,char* val);
|
@@ -1555,7 +1555,8 @@ extern void nativebar_switch_tab(int index);
|
|
1555
1555
|
#define switch_tab nativebar_switch_tab
|
1556
1556
|
extern VALUE nativebar_started();
|
1557
1557
|
#define started nativebar_started
|
1558
|
-
|
1558
|
+
extern void nativebar_set_tab_badge(int index,char* val);
|
1559
|
+
#define set_tab_badge nativebar_set_tab_badge
|
1559
1560
|
|
1560
1561
|
#include <limits.h>
|
1561
1562
|
#ifndef LLONG_MIN
|
@@ -1683,6 +1684,29 @@ fail:
|
|
1683
1684
|
return Qnil;
|
1684
1685
|
}
|
1685
1686
|
|
1687
|
+
SWIGINTERN VALUE
|
1688
|
+
_wrap_set_tab_badge(int argc, VALUE *argv, VALUE self) {
|
1689
|
+
int arg1 ;
|
1690
|
+
char* arg2 = 0;
|
1691
|
+
int val1 ;
|
1692
|
+
int ecode1 = 0 ;
|
1693
|
+
|
1694
|
+
if ((argc < 2) || (argc > 2)) {
|
1695
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
1696
|
+
}
|
1697
|
+
|
1698
|
+
ecode1 = SWIG_AsVal_int(argv[0], &val1);
|
1699
|
+
if (!SWIG_IsOK(ecode1)) {
|
1700
|
+
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "set_tab_badge" "', argument " "1"" of type '" "int""'");
|
1701
|
+
}
|
1702
|
+
arg1 = (int)(val1);
|
1703
|
+
arg2 = getStringFromValue(argv[1]);
|
1704
|
+
set_tab_badge(arg1,arg2);
|
1705
|
+
return Qnil;
|
1706
|
+
fail:
|
1707
|
+
return Qnil;
|
1708
|
+
}
|
1709
|
+
|
1686
1710
|
|
1687
1711
|
SWIGINTERN VALUE
|
1688
1712
|
_wrap_started(int argc, VALUE *argv, VALUE self) {
|
@@ -1970,5 +1994,6 @@ SWIGEXPORT void Init_NativeBar(void) {
|
|
1970
1994
|
rb_define_module_function(mNativeBar, "remove", _wrap_remove, -1);
|
1971
1995
|
rb_define_module_function(mNativeBar, "switch_tab", _wrap_switch_tab, -1);
|
1972
1996
|
rb_define_module_function(mNativeBar, "started", _wrap_started, -1);
|
1997
|
+
rb_define_module_function(mNativeBar, "set_tab_badge", _wrap_set_tab_badge, -1);
|
1973
1998
|
}
|
1974
1999
|
|
@@ -102,6 +102,7 @@ struct CRhoRubyStringOrInt rho_ruby_getstringorint(VALUE val);
|
|
102
102
|
const char* rho_ruby_getMessageText(const char* szName);
|
103
103
|
const char* rho_ruby_getErrorText(int nError);
|
104
104
|
const char* rho_ruby_internal_getErrorText(int nError);
|
105
|
+
const char* rho_ruby_internal_getMessageText(const char* szName);
|
105
106
|
|
106
107
|
VALUE rho_ruby_create_mutex();
|
107
108
|
void rho_ruby_destroy_mutex(VALUE val);
|
@@ -561,10 +561,23 @@ static void Init_RhoJSON()
|
|
561
561
|
rb_define_singleton_method(rb_RhoJSON, "quote_value", rho_json_quote_value, 1);
|
562
562
|
}
|
563
563
|
|
564
|
+
static VALUE rb_RhoMessages;
|
565
|
+
static ID get_message_mid;
|
564
566
|
const char* rho_ruby_internal_getMessageText(const char* szName)
|
565
567
|
{
|
566
|
-
|
567
|
-
|
568
|
+
VALUE callres, strVal;
|
569
|
+
const char* szValue;
|
570
|
+
if ( !rb_RhoMessages )
|
571
|
+
{
|
572
|
+
rb_RhoMessages = rb_const_get(rb_RhoModule,rb_intern("RhoMessages"));
|
573
|
+
CONST_ID(get_message_mid, "get_message");
|
574
|
+
}
|
575
|
+
|
576
|
+
callres = rb_funcall(rb_RhoMessages, get_message_mid, 1, rb_str_new2(szName) );
|
577
|
+
strVal = rb_funcall(callres, rb_intern("to_s"), 0);
|
578
|
+
szValue = RSTRING_PTR(strVal);
|
579
|
+
|
580
|
+
return szValue;
|
568
581
|
}
|
569
582
|
|
570
583
|
static VALUE rb_RhoError;
|
@@ -20,8 +20,11 @@
|
|
20
20
|
#define set_notification rho_sync_set_notification
|
21
21
|
extern void rho_sync_clear_notification(int source_id);
|
22
22
|
#define clear_notification rho_sync_clear_notification
|
23
|
-
extern
|
23
|
+
extern int rho_sync_set_pollinterval(int interval);
|
24
24
|
#define set_pollinterval rho_sync_set_pollinterval
|
25
|
+
extern int rho_sync_get_pollinterval();
|
26
|
+
#define get_pollinterval rho_sync_get_pollinterval
|
27
|
+
|
25
28
|
extern void rho_sync_set_syncserver(char* syncserver);
|
26
29
|
#define set_syncserver rho_sync_set_syncserver
|
27
30
|
extern VALUE rho_sync_get_attrs(const char* szPartition, int source_id);
|
@@ -51,6 +54,12 @@
|
|
51
54
|
#define clear_bulk_notification rho_sync_clear_bulk_notification
|
52
55
|
extern void rho_sync_set_threaded_mode(int b);
|
53
56
|
#define set_threaded_mode rho_sync_set_threaded_mode
|
57
|
+
|
58
|
+
extern void rho_sync_enable_status_popup(int b);
|
59
|
+
#define enable_status_popup rho_sync_enable_status_popup
|
60
|
+
|
61
|
+
extern void rho_sync_set_source_property(int nSrcID, const char* szPropName, const char* szPropValue);
|
62
|
+
#define set_source_property rho_sync_set_source_property
|
54
63
|
|
55
64
|
#if !defined(bool)
|
56
65
|
#define bool int
|
@@ -71,7 +80,8 @@ extern void logout();
|
|
71
80
|
extern void stop_sync();
|
72
81
|
extern void set_notification(int source_id, const char *url, char* params);
|
73
82
|
extern void clear_notification(int source_id);
|
74
|
-
extern
|
83
|
+
extern int set_pollinterval(int interval);
|
84
|
+
extern int get_pollinterval();
|
75
85
|
extern void set_syncserver(char* syncserver);
|
76
86
|
extern VALUE get_src_attrs(const char* szPartition, int source_id);
|
77
87
|
extern VALUE is_blob_attr(const char* szPartition, int source_id, const char* szAttrName);
|
@@ -82,3 +92,5 @@ extern int get_lastsync_objectcount(int nSrcID);
|
|
82
92
|
extern int get_pagesize();
|
83
93
|
extern void set_pagesize(int pagesize);
|
84
94
|
extern void set_threaded_mode(bool b);
|
95
|
+
extern void enable_status_popup(bool b);
|
96
|
+
extern void set_source_property(int nSrcID, const char* szPropName, const char* szPropValue);
|
@@ -1833,8 +1833,11 @@ static VALUE mSyncEngine;
|
|
1833
1833
|
#define set_notification rho_sync_set_notification
|
1834
1834
|
extern void rho_sync_clear_notification(int source_id);
|
1835
1835
|
#define clear_notification rho_sync_clear_notification
|
1836
|
-
extern
|
1836
|
+
extern int rho_sync_set_pollinterval(int interval);
|
1837
1837
|
#define set_pollinterval rho_sync_set_pollinterval
|
1838
|
+
extern int rho_sync_get_pollinterval();
|
1839
|
+
#define get_pollinterval rho_sync_get_pollinterval
|
1840
|
+
|
1838
1841
|
extern void rho_sync_set_syncserver(char* syncserver);
|
1839
1842
|
#define set_syncserver rho_sync_set_syncserver
|
1840
1843
|
extern VALUE rho_sync_get_attrs(const char* szPartition, int source_id);
|
@@ -1864,6 +1867,12 @@ static VALUE mSyncEngine;
|
|
1864
1867
|
#define clear_bulk_notification rho_sync_clear_bulk_notification
|
1865
1868
|
extern void rho_sync_set_threaded_mode(int b);
|
1866
1869
|
#define set_threaded_mode rho_sync_set_threaded_mode
|
1870
|
+
|
1871
|
+
extern void rho_sync_enable_status_popup(int b);
|
1872
|
+
#define enable_status_popup rho_sync_enable_status_popup
|
1873
|
+
|
1874
|
+
extern void rho_sync_set_source_property(int nSrcID, const char* szPropName, const char* szPropValue);
|
1875
|
+
#define set_source_property rho_sync_set_source_property
|
1867
1876
|
|
1868
1877
|
#if !defined(bool)
|
1869
1878
|
#define bool int
|
@@ -2313,6 +2322,8 @@ _wrap_set_pollinterval(int argc, VALUE *argv, VALUE self) {
|
|
2313
2322
|
int arg1 ;
|
2314
2323
|
int val1 ;
|
2315
2324
|
int ecode1 = 0 ;
|
2325
|
+
int result;
|
2326
|
+
VALUE vresult = Qnil;
|
2316
2327
|
|
2317
2328
|
if ((argc < 1) || (argc > 1)) {
|
2318
2329
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
@@ -2322,8 +2333,25 @@ _wrap_set_pollinterval(int argc, VALUE *argv, VALUE self) {
|
|
2322
2333
|
SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","set_pollinterval", 1, argv[0] ));
|
2323
2334
|
}
|
2324
2335
|
arg1 = (int)(val1);
|
2325
|
-
set_pollinterval(arg1);
|
2336
|
+
result = (int)set_pollinterval(arg1);
|
2337
|
+
vresult = SWIG_From_int((int)(result));
|
2338
|
+
return vresult;
|
2339
|
+
fail:
|
2326
2340
|
return Qnil;
|
2341
|
+
}
|
2342
|
+
|
2343
|
+
|
2344
|
+
SWIGINTERN VALUE
|
2345
|
+
_wrap_get_pollinterval(int argc, VALUE *argv, VALUE self) {
|
2346
|
+
int result;
|
2347
|
+
VALUE vresult = Qnil;
|
2348
|
+
|
2349
|
+
if ((argc < 0) || (argc > 0)) {
|
2350
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2351
|
+
}
|
2352
|
+
result = (int)get_pollinterval();
|
2353
|
+
vresult = SWIG_From_int((int)(result));
|
2354
|
+
return vresult;
|
2327
2355
|
fail:
|
2328
2356
|
return Qnil;
|
2329
2357
|
}
|
@@ -2584,6 +2612,70 @@ fail:
|
|
2584
2612
|
}
|
2585
2613
|
|
2586
2614
|
|
2615
|
+
SWIGINTERN VALUE
|
2616
|
+
_wrap_enable_status_popup(int argc, VALUE *argv, VALUE self) {
|
2617
|
+
bool arg1 ;
|
2618
|
+
bool val1 ;
|
2619
|
+
int ecode1 = 0 ;
|
2620
|
+
|
2621
|
+
if ((argc < 1) || (argc > 1)) {
|
2622
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2623
|
+
}
|
2624
|
+
ecode1 = SWIG_AsVal_bool(argv[0], &val1);
|
2625
|
+
if (!SWIG_IsOK(ecode1)) {
|
2626
|
+
SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "bool","enable_status_popup", 1, argv[0] ));
|
2627
|
+
}
|
2628
|
+
arg1 = (bool)(val1);
|
2629
|
+
enable_status_popup(arg1);
|
2630
|
+
return Qnil;
|
2631
|
+
fail:
|
2632
|
+
return Qnil;
|
2633
|
+
}
|
2634
|
+
|
2635
|
+
|
2636
|
+
SWIGINTERN VALUE
|
2637
|
+
_wrap_set_source_property(int argc, VALUE *argv, VALUE self) {
|
2638
|
+
int arg1 ;
|
2639
|
+
char *arg2 = (char *) 0 ;
|
2640
|
+
char *arg3 = (char *) 0 ;
|
2641
|
+
int val1 ;
|
2642
|
+
int ecode1 = 0 ;
|
2643
|
+
int res2 ;
|
2644
|
+
char *buf2 = 0 ;
|
2645
|
+
int alloc2 = 0 ;
|
2646
|
+
int res3 ;
|
2647
|
+
char *buf3 = 0 ;
|
2648
|
+
int alloc3 = 0 ;
|
2649
|
+
|
2650
|
+
if ((argc < 3) || (argc > 3)) {
|
2651
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
|
2652
|
+
}
|
2653
|
+
ecode1 = SWIG_AsVal_int(argv[0], &val1);
|
2654
|
+
if (!SWIG_IsOK(ecode1)) {
|
2655
|
+
SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","set_source_property", 1, argv[0] ));
|
2656
|
+
}
|
2657
|
+
arg1 = (int)(val1);
|
2658
|
+
res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
|
2659
|
+
if (!SWIG_IsOK(res2)) {
|
2660
|
+
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","set_source_property", 2, argv[1] ));
|
2661
|
+
}
|
2662
|
+
arg2 = (char *)(buf2);
|
2663
|
+
res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
|
2664
|
+
if (!SWIG_IsOK(res3)) {
|
2665
|
+
SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","set_source_property", 3, argv[2] ));
|
2666
|
+
}
|
2667
|
+
arg3 = (char *)(buf3);
|
2668
|
+
set_source_property(arg1,(char const *)arg2,(char const *)arg3);
|
2669
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2670
|
+
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
|
2671
|
+
return Qnil;
|
2672
|
+
fail:
|
2673
|
+
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
|
2674
|
+
if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
|
2675
|
+
return Qnil;
|
2676
|
+
}
|
2677
|
+
|
2678
|
+
|
2587
2679
|
|
2588
2680
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
2589
2681
|
|
@@ -2867,6 +2959,7 @@ SWIGEXPORT void Init_SyncEngine(void) {
|
|
2867
2959
|
rb_define_module_function(mSyncEngine, "set_notification", _wrap_set_notification, -1);
|
2868
2960
|
rb_define_module_function(mSyncEngine, "clear_notification", _wrap_clear_notification, -1);
|
2869
2961
|
rb_define_module_function(mSyncEngine, "set_pollinterval", _wrap_set_pollinterval, -1);
|
2962
|
+
rb_define_module_function(mSyncEngine, "get_pollinterval", _wrap_get_pollinterval, -1);
|
2870
2963
|
rb_define_module_function(mSyncEngine, "set_syncserver", _wrap_set_syncserver, -1);
|
2871
2964
|
rb_define_module_function(mSyncEngine, "get_src_attrs", _wrap_get_src_attrs, -1);
|
2872
2965
|
rb_define_module_function(mSyncEngine, "is_blob_attr", _wrap_is_blob_attr, -1);
|
@@ -2877,5 +2970,7 @@ SWIGEXPORT void Init_SyncEngine(void) {
|
|
2877
2970
|
rb_define_module_function(mSyncEngine, "get_pagesize", _wrap_get_pagesize, -1);
|
2878
2971
|
rb_define_module_function(mSyncEngine, "set_pagesize", _wrap_set_pagesize, -1);
|
2879
2972
|
rb_define_module_function(mSyncEngine, "set_threaded_mode", _wrap_set_threaded_mode, -1);
|
2973
|
+
rb_define_module_function(mSyncEngine, "enable_status_popup", _wrap_enable_status_popup, -1);
|
2974
|
+
rb_define_module_function(mSyncEngine, "set_source_property", _wrap_set_source_property, -1);
|
2880
2975
|
}
|
2881
2976
|
|
@@ -36,9 +36,18 @@ 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 get_start_params rho_sys_get_start_params
|
40
|
+
extern const char* rho_sys_get_start_params();
|
41
|
+
|
39
42
|
#define open_url rho_sys_open_url
|
40
43
|
extern void rho_sys_open_url(const char* url);
|
41
44
|
|
45
|
+
#define app_installed rho_sys_is_app_installed
|
46
|
+
extern int rho_sys_is_app_installed(const char *appname);
|
47
|
+
|
48
|
+
#define app_uninstall rho_sys_app_uninstall
|
49
|
+
extern void rho_sys_app_uninstall(const char *appname);
|
50
|
+
|
42
51
|
#if !defined(bool)
|
43
52
|
#define bool int
|
44
53
|
#define true 1
|
@@ -83,4 +92,8 @@ extern void exit();
|
|
83
92
|
extern void unzip_file( const char *path );
|
84
93
|
extern int set_sleeping( bool sleeping );
|
85
94
|
extern void run_app(const char *appname, VALUE params);
|
95
|
+
extern const char* get_start_params();
|
86
96
|
extern void open_url(const char *url);
|
97
|
+
%predicate app_installed(const char *appname);
|
98
|
+
extern int app_installed(const char *appname);
|
99
|
+
extern void app_uninstall(const char *appname);
|
@@ -1850,9 +1850,18 @@ 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 get_start_params rho_sys_get_start_params
|
1854
|
+
extern const char* rho_sys_get_start_params();
|
1855
|
+
|
1853
1856
|
#define open_url rho_sys_open_url
|
1854
1857
|
extern void rho_sys_open_url(const char* url);
|
1855
1858
|
|
1859
|
+
#define app_installed rho_sys_is_app_installed
|
1860
|
+
extern int rho_sys_is_app_installed(const char *appname);
|
1861
|
+
|
1862
|
+
#define app_uninstall rho_sys_app_uninstall
|
1863
|
+
extern void rho_sys_app_uninstall(const char *appname);
|
1864
|
+
|
1856
1865
|
#if !defined(bool)
|
1857
1866
|
#define bool int
|
1858
1867
|
#define true 1
|
@@ -1932,7 +1941,7 @@ SWIG_ruby_failed(void)
|
|
1932
1941
|
}
|
1933
1942
|
|
1934
1943
|
|
1935
|
-
/*@SWIG:
|
1944
|
+
/*@SWIG:C:\Rhode\swigwin-2.0.0\Lib\ruby\rubyprimtypes.swg,19,%ruby_aux_method@*/
|
1936
1945
|
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
|
1937
1946
|
{
|
1938
1947
|
VALUE obj = args[0];
|
@@ -2006,6 +2015,30 @@ SWIG_AsVal_bool (VALUE obj, bool *val)
|
|
2006
2015
|
return SWIG_TypeError;
|
2007
2016
|
}
|
2008
2017
|
|
2018
|
+
|
2019
|
+
SWIGINTERNINLINE VALUE
|
2020
|
+
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
|
2021
|
+
{
|
2022
|
+
if (carray) {
|
2023
|
+
if (size > LONG_MAX) {
|
2024
|
+
swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
|
2025
|
+
return pchar_descriptor ?
|
2026
|
+
SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : Qnil;
|
2027
|
+
} else {
|
2028
|
+
return rb_str_new(carray, (long)(size));
|
2029
|
+
}
|
2030
|
+
} else {
|
2031
|
+
return Qnil;
|
2032
|
+
}
|
2033
|
+
}
|
2034
|
+
|
2035
|
+
|
2036
|
+
SWIGINTERNINLINE VALUE
|
2037
|
+
SWIG_FromCharPtr(const char *cptr)
|
2038
|
+
{
|
2039
|
+
return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
|
2040
|
+
}
|
2041
|
+
|
2009
2042
|
SWIGINTERN VALUE
|
2010
2043
|
_wrap_syscall(int argc, VALUE *argv, VALUE self) {
|
2011
2044
|
char *arg1 = (char *) 0 ;
|
@@ -2314,6 +2347,22 @@ fail:
|
|
2314
2347
|
}
|
2315
2348
|
|
2316
2349
|
|
2350
|
+
SWIGINTERN VALUE
|
2351
|
+
_wrap_get_start_params(int argc, VALUE *argv, VALUE self) {
|
2352
|
+
char *result = 0 ;
|
2353
|
+
VALUE vresult = Qnil;
|
2354
|
+
|
2355
|
+
if ((argc < 0) || (argc > 0)) {
|
2356
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
2357
|
+
}
|
2358
|
+
result = (char *)get_start_params();
|
2359
|
+
vresult = SWIG_FromCharPtr((const char *)result);
|
2360
|
+
return vresult;
|
2361
|
+
fail:
|
2362
|
+
return Qnil;
|
2363
|
+
}
|
2364
|
+
|
2365
|
+
|
2317
2366
|
SWIGINTERN VALUE
|
2318
2367
|
_wrap_open_url(int argc, VALUE *argv, VALUE self) {
|
2319
2368
|
char *arg1 = (char *) 0 ;
|
@@ -2338,6 +2387,57 @@ fail:
|
|
2338
2387
|
}
|
2339
2388
|
|
2340
2389
|
|
2390
|
+
SWIGINTERN VALUE
|
2391
|
+
_wrap_app_installedq___(int argc, VALUE *argv, VALUE self) {
|
2392
|
+
char *arg1 = (char *) 0 ;
|
2393
|
+
int res1 ;
|
2394
|
+
char *buf1 = 0 ;
|
2395
|
+
int alloc1 = 0 ;
|
2396
|
+
int result;
|
2397
|
+
VALUE vresult = Qnil;
|
2398
|
+
|
2399
|
+
if ((argc < 1) || (argc > 1)) {
|
2400
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2401
|
+
}
|
2402
|
+
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
2403
|
+
if (!SWIG_IsOK(res1)) {
|
2404
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","app_installed", 1, argv[0] ));
|
2405
|
+
}
|
2406
|
+
arg1 = (char *)(buf1);
|
2407
|
+
result = (int)app_installed((char const *)arg1);
|
2408
|
+
vresult = (result ? Qtrue : Qfalse);
|
2409
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2410
|
+
return vresult;
|
2411
|
+
fail:
|
2412
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2413
|
+
return Qnil;
|
2414
|
+
}
|
2415
|
+
|
2416
|
+
|
2417
|
+
SWIGINTERN VALUE
|
2418
|
+
_wrap_app_uninstall(int argc, VALUE *argv, VALUE self) {
|
2419
|
+
char *arg1 = (char *) 0 ;
|
2420
|
+
int res1 ;
|
2421
|
+
char *buf1 = 0 ;
|
2422
|
+
int alloc1 = 0 ;
|
2423
|
+
|
2424
|
+
if ((argc < 1) || (argc > 1)) {
|
2425
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
2426
|
+
}
|
2427
|
+
res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
|
2428
|
+
if (!SWIG_IsOK(res1)) {
|
2429
|
+
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","app_uninstall", 1, argv[0] ));
|
2430
|
+
}
|
2431
|
+
arg1 = (char *)(buf1);
|
2432
|
+
app_uninstall((char const *)arg1);
|
2433
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2434
|
+
return Qnil;
|
2435
|
+
fail:
|
2436
|
+
if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
|
2437
|
+
return Qnil;
|
2438
|
+
}
|
2439
|
+
|
2440
|
+
|
2341
2441
|
|
2342
2442
|
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
|
2343
2443
|
|
@@ -2627,6 +2727,9 @@ SWIGEXPORT void Init_System(void) {
|
|
2627
2727
|
rb_define_module_function(mSystem, "unzip_file", _wrap_unzip_file, -1);
|
2628
2728
|
rb_define_module_function(mSystem, "set_sleeping", _wrap_set_sleeping, -1);
|
2629
2729
|
rb_define_module_function(mSystem, "run_app", _wrap_run_app, -1);
|
2730
|
+
rb_define_module_function(mSystem, "get_start_params", _wrap_get_start_params, -1);
|
2630
2731
|
rb_define_module_function(mSystem, "open_url", _wrap_open_url, -1);
|
2732
|
+
rb_define_module_function(mSystem, "app_installed?", _wrap_app_installedq___, -1);
|
2733
|
+
rb_define_module_function(mSystem, "app_uninstall", _wrap_app_uninstall, -1);
|
2631
2734
|
}
|
2632
2735
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "common/RhoAppAdapter.h"
|
2
|
+
#include "sync/SyncThread.h"
|
2
3
|
#include "ruby/ext/rho/rhoruby.h"
|
3
4
|
|
4
5
|
namespace rho {
|
@@ -6,11 +7,17 @@ const _CRhoAppAdapter& RhoAppAdapter = _CRhoAppAdapter();
|
|
6
7
|
|
7
8
|
/*static*/ String _CRhoAppAdapter::getMessageText(const char* szName)
|
8
9
|
{
|
10
|
+
if ( sync::CSyncThread::getInstance()->isNoThreadedMode() || !sync::CSyncThread::getInstance()->getSyncEngine().getNotify().isReportingEnabled() )
|
11
|
+
return String();
|
12
|
+
|
9
13
|
return rho_ruby_getMessageText(szName);
|
10
14
|
}
|
11
15
|
|
12
16
|
/*static*/ String _CRhoAppAdapter::getErrorText(int nError)
|
13
17
|
{
|
18
|
+
if ( sync::CSyncThread::getInstance()->isNoThreadedMode() || !sync::CSyncThread::getInstance()->getSyncEngine().getNotify().isReportingEnabled() )
|
19
|
+
return String();
|
20
|
+
|
14
21
|
return rho_ruby_getErrorText(nError);
|
15
22
|
}
|
16
23
|
|