rhodes 2.0.0.beta2 → 2.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +2 -0
- data/Manifest.txt +27 -148
- data/Rakefile +49 -3
- data/lib/framework/builtinME.rb +6 -0
- data/lib/framework/rho/render.rb +13 -8
- data/lib/framework/rho/rho.rb +97 -43
- data/lib/framework/rho/rhoapplication.rb +8 -3
- data/lib/framework/rho/rhocontroller.rb +1 -1
- data/lib/framework/rhodes-framework.rb +1 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +7 -22
- data/lib/framework/rhofsconnector.rb +1 -1
- data/lib/framework/rholang/localization_simplified.rb +2 -2
- data/lib/framework/rhom/rhom.rb +1 -0
- data/lib/framework/rhom/rhom_db_adapter.rb +2 -2
- data/lib/framework/rhom/rhom_model.rb +98 -0
- data/lib/framework/rhom/rhom_object_factory.rb +13 -12
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/include/{JNIRhodes.h → rhodes/JNIRhodes.h} +3 -54
- data/platform/android/Rhodes/jni/include/{RhoClassFactory.h → rhodes/RhoClassFactory.h} +0 -0
- data/platform/android/Rhodes/jni/include/{SystemInfoImpl.h → rhodes/SystemInfoImpl.h} +0 -0
- data/platform/android/Rhodes/jni/include/{details → rhodes/details}/rhojava.inc +1 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Logger.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoConf.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoLogConf.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoMenu.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_Rhodes.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_SplashScreen.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_alert_Alert.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_camera_Camera.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_datetime_DateTimePicker.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_geolocation_GeoLocationImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_RhoSocketImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_socket_SSLImpl.h +0 -0
- data/platform/android/Rhodes/jni/include/{sslimpl.h → rhodes/sslimpl.h} +0 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +59 -0
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +3 -3
- data/platform/android/Rhodes/jni/src/alert.cpp +2 -2
- data/platform/android/Rhodes/jni/src/callbacks.cpp +4 -3
- data/platform/android/Rhodes/jni/src/camera.cpp +2 -2
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +2 -2
- data/platform/android/Rhodes/jni/src/geolocation.cpp +2 -2
- data/platform/android/Rhodes/jni/src/logconf.cpp +2 -2
- data/platform/android/Rhodes/jni/src/logger.cpp +2 -2
- data/platform/android/Rhodes/jni/src/mapview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/menu.cpp +2 -2
- data/platform/android/Rhodes/jni/src/nativebar.cpp +1 -1
- data/platform/android/Rhodes/jni/src/navbar.cpp +17 -3
- data/platform/android/Rhodes/jni/src/phonebook.cpp +1 -1
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +2 -2
- data/platform/android/Rhodes/jni/src/rhodes.cpp +3 -3
- data/platform/android/Rhodes/jni/src/ringtones.cpp +1 -1
- data/platform/android/Rhodes/jni/src/socketimpl.cpp +2 -2
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +2 -2
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
- data/platform/android/Rhodes/jni/src/syncengine.cpp +2 -2
- data/platform/android/Rhodes/jni/src/webview.cpp +15 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +11 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +52 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +8 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +26 -28
- data/platform/android/build/RhodesSRC_build.files +21 -20
- data/platform/android/build/android.rake +69 -24
- data/platform/android/build/androidcommon.rb +17 -12
- data/platform/bb/build/bb.rake +23 -21
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +5 -2
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +6 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +9 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +31 -2
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +17 -6
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +6 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +16 -4
- data/platform/iphone/Classes/DateTime.h +5 -6
- data/platform/iphone/Classes/DateTimePicker.m +4 -18
- data/platform/iphone/Classes/DateTimePickerDelegate.h +7 -9
- data/platform/iphone/Classes/DateTimePickerDelegate.m +141 -152
- data/platform/iphone/Classes/Rhodes.h +6 -1
- data/platform/iphone/Classes/Rhodes.m +17 -43
- data/platform/iphone/Classes/SimpleMainView.h +1 -1
- data/platform/iphone/Classes/SimpleMainView.m +54 -4
- data/platform/iphone/Classes/WebView.m +17 -0
- data/platform/iphone/rbuild/iphone.rake +1 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +0 -45
- data/platform/shared/common/PosixThreadImpl.cpp +8 -0
- data/platform/shared/common/PosixThreadImpl.h +1 -0
- data/platform/shared/common/RhoThread.cpp +1 -0
- data/platform/shared/common/RhoThread.h +4 -2
- data/platform/shared/curl/include/curl/curl.h +4 -0
- data/platform/shared/db/DBAdapter.cpp +47 -60
- data/platform/shared/db/DBAdapter.h +6 -2
- data/platform/shared/net/AsyncHttp.cpp +27 -11
- data/platform/shared/net/AsyncHttp.h +3 -1
- data/platform/shared/net/CURLNetRequest.cpp +11 -10
- data/platform/shared/net/CURLNetRequest.h +6 -4
- data/platform/shared/net/HttpServer.cpp +11 -6
- data/platform/shared/ruby/ext/asynchttp/asynchttp.i +2 -2
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +22 -11
- data/platform/shared/ruby/ext/rho/rhoruby.c +2 -2
- data/platform/shared/ruby/ext/rho/rhosupport.c +23 -3
- data/platform/shared/ruby/ext/webview/webview.i +4 -0
- data/platform/shared/ruby/ext/webview/webview_wrap.c +39 -0
- data/platform/shared/ruby/re.c +8 -0
- data/platform/shared/ruby/string.c +1 -1
- data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +6 -1
- data/platform/shared/rubyJVM/src/com/rho/RhoThread.java +3 -0
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +34 -0
- data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +40 -53
- data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +32 -15
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +31 -17
- data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +3 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONArrayIterator.java +17 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +158 -137
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +18 -17
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +10 -2
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubyFile_Methods.java +6 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyFile.java +18 -3
- data/platform/shared/rubyJVM/src/j2me/io/File.java +37 -9
- data/platform/shared/sqlite/sqlite3.c +14613 -13016
- data/platform/shared/sqlite/sqlite3.h +1461 -1499
- data/platform/shared/sqlite/sqlite3ext.h +0 -2
- data/platform/shared/sync/ClientRegister.cpp +3 -3
- data/platform/shared/sync/ClientRegister.h +2 -1
- data/platform/shared/sync/SyncEngine.cpp +20 -8
- data/platform/shared/sync/SyncSource.cpp +12 -12
- data/platform/shared/sync/SyncSource.h +4 -4
- data/platform/shared/sync/SyncThread.cpp +8 -1
- data/platform/shared/tcmalloc/rhomem.h +3 -0
- data/platform/shared/tcmalloc/tcmalloc_.cpp +11 -0
- data/platform/wm/rhodes/Alert.cpp +148 -101
- data/platform/wm/rhodes/Alert.h +4 -1
- data/platform/wm/rhodes/AppManager.cpp +212 -72
- data/platform/wm/rhodes/AppManager.h +24 -3
- data/platform/wm/rhodes/DateTimePicker.cpp +23 -11
- data/platform/wm/rhodes/DateTimePicker.h +16 -5
- data/platform/wm/rhodes/MainWindow.cpp +22 -7
- data/platform/wm/rhodes/OkCancelModalDialog.h +63 -0
- data/platform/wm/rhodes/Rhodes.cpp +29 -17
- data/platform/wm/rhodes/phonebook/NativeAddressBook.cpp +128 -4
- data/platform/wm/rhodes/phonebook/NativeAddressBook.h +33 -3
- data/platform/wm/rhodes/resource.h +1 -1
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +5 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +136 -102
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +12 -5
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +24 -10
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +6 -0
- data/platform/wm/rhodes/rhodes.vcproj +4 -0
- data/platform/wm/tools/detool/detool.cpp +17 -4
- data/rakefile.rb +49 -3
- data/res/build-tools/db/syncdb.schema +2 -2
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +10 -10
- data/res/generators/templates/application/app/helpers/browser_helper.rb +9 -4
- data/res/generators/templates/application/app/index.bb.erb +5 -5
- data/res/generators/templates/application/build.yml +1 -0
- data/res/generators/templates/application/public/css/android.css +10 -8
- data/res/generators/templates/application/public/css/blackberry.css +40 -31
- data/res/generators/templates/application/public/css/iphone.css +4 -4
- data/res/generators/templates/application/public/css/webkit.css +7 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +31 -27
- data/res/generators/templates/application/rhoconfig.txt +2 -2
- data/res/generators/templates/model/edit.bb.erb +2 -2
- data/res/generators/templates/model/index.bb.erb +6 -4
- data/res/generators/templates/model/model.rb +2 -1
- data/res/generators/templates/model/new.bb.erb +2 -2
- data/res/generators/templates/model/show.bb.erb +2 -2
- data/rhobuild.yml +37 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/Account/account.rb +7 -0
- data/spec/framework_spec/app/Case/case.rb +6 -0
- data/spec/framework_spec/app/Customer/customer.rb +6 -0
- data/spec/framework_spec/app/Product/product.rb +9 -0
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +1 -1
- data/spec/framework_spec/app/spec/syncengine_spec.rb +2 -1
- metadata +45 -151
- data/lib/build/manifest/createAppManifest.rb +0 -18
- data/lib/build/tasks/android.rake +0 -317
- data/lib/build/tasks/blackberry.rake +0 -355
- data/lib/build/tasks/common.rake +0 -62
- data/lib/build/tasks/iphone.rake +0 -108
- data/lib/build/tasks/linux.rake +0 -81
- data/lib/build/tasks/rhodes-build.rb +0 -11
- data/lib/build/tasks/rspec.rake +0 -20
- data/lib/build/tasks/symbian.rake +0 -202
- data/lib/build/tasks/wm.rake +0 -166
- data/lib/framework/ServeME.rb +0 -7
- data/platform/bb/build/MANIFEST.MF +0 -12
- data/platform/iphone/Classes/DateTimePicker.h +0 -17
- data/res/generators/templates/application/public/icons/Read me first - license.txt +0 -14
- data/res/generators/templates/application/public/icons/about.png +0 -0
- data/res/generators/templates/application/public/icons/airplane.png +0 -0
- data/res/generators/templates/application/public/icons/baby.png +0 -0
- data/res/generators/templates/application/public/icons/badge.png +0 -0
- data/res/generators/templates/application/public/icons/bandaid.png +0 -0
- data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
- data/res/generators/templates/application/public/icons/battery.png +0 -0
- data/res/generators/templates/application/public/icons/beaker.png +0 -0
- data/res/generators/templates/application/public/icons/beaker2.png +0 -0
- data/res/generators/templates/application/public/icons/beermug.png +0 -0
- data/res/generators/templates/application/public/icons/bird.png +0 -0
- data/res/generators/templates/application/public/icons/book.png +0 -0
- data/res/generators/templates/application/public/icons/bookmark.png +0 -0
- data/res/generators/templates/application/public/icons/brightness.png +0 -0
- data/res/generators/templates/application/public/icons/bug.png +0 -0
- data/res/generators/templates/application/public/icons/cabinet.png +0 -0
- data/res/generators/templates/application/public/icons/calendar.png +0 -0
- data/res/generators/templates/application/public/icons/camera.png +0 -0
- data/res/generators/templates/application/public/icons/changeName.rb +0 -22
- data/res/generators/templates/application/public/icons/chat2.png +0 -0
- data/res/generators/templates/application/public/icons/chicken.png +0 -0
- data/res/generators/templates/application/public/icons/clock.png +0 -0
- data/res/generators/templates/application/public/icons/cloud.png +0 -0
- data/res/generators/templates/application/public/icons/coffee.png +0 -0
- data/res/generators/templates/application/public/icons/compass.png +0 -0
- data/res/generators/templates/application/public/icons/contrast.png +0 -0
- data/res/generators/templates/application/public/icons/dashboard.png +0 -0
- data/res/generators/templates/application/public/icons/display.png +0 -0
- data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
- data/res/generators/templates/application/public/icons/download.png +0 -0
- data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
- data/res/generators/templates/application/public/icons/ekg.png +0 -0
- data/res/generators/templates/application/public/icons/envelope.png +0 -0
- data/res/generators/templates/application/public/icons/equalizer.png +0 -0
- data/res/generators/templates/application/public/icons/eye.png +0 -0
- data/res/generators/templates/application/public/icons/film-roll.png +0 -0
- data/res/generators/templates/application/public/icons/flag.png +0 -0
- data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
- data/res/generators/templates/application/public/icons/fuel.png +0 -0
- data/res/generators/templates/application/public/icons/gameplan.png +0 -0
- data/res/generators/templates/application/public/icons/gear.png +0 -0
- data/res/generators/templates/application/public/icons/gear2.png +0 -0
- data/res/generators/templates/application/public/icons/gift.png +0 -0
- data/res/generators/templates/application/public/icons/heart.png +0 -0
- data/res/generators/templates/application/public/icons/house.png +0 -0
- data/res/generators/templates/application/public/icons/inbox.png +0 -0
- data/res/generators/templates/application/public/icons/index-cards.png +0 -0
- data/res/generators/templates/application/public/icons/iphone.png +0 -0
- data/res/generators/templates/application/public/icons/ipod.png +0 -0
- data/res/generators/templates/application/public/icons/key.png +0 -0
- data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
- data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
- data/res/generators/templates/application/public/icons/line-chart.png +0 -0
- data/res/generators/templates/application/public/icons/location.png +0 -0
- data/res/generators/templates/application/public/icons/lock.png +0 -0
- data/res/generators/templates/application/public/icons/loopback.png +0 -0
- data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
- data/res/generators/templates/application/public/icons/map-marker.png +0 -0
- data/res/generators/templates/application/public/icons/map.png +0 -0
- data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
- data/res/generators/templates/application/public/icons/medical.png +0 -0
- data/res/generators/templates/application/public/icons/microphone.png +0 -0
- data/res/generators/templates/application/public/icons/movie1.png +0 -0
- data/res/generators/templates/application/public/icons/movie2.png +0 -0
- data/res/generators/templates/application/public/icons/network.png +0 -0
- data/res/generators/templates/application/public/icons/note.png +0 -0
- data/res/generators/templates/application/public/icons/outlet.png +0 -0
- data/res/generators/templates/application/public/icons/palette.png +0 -0
- data/res/generators/templates/application/public/icons/paperclip.png +0 -0
- data/res/generators/templates/application/public/icons/phone.png +0 -0
- data/res/generators/templates/application/public/icons/photos.png +0 -0
- data/res/generators/templates/application/public/icons/piano.png +0 -0
- data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
- data/res/generators/templates/application/public/icons/pill.png +0 -0
- data/res/generators/templates/application/public/icons/pin.png +0 -0
- data/res/generators/templates/application/public/icons/pinetree.png +0 -0
- data/res/generators/templates/application/public/icons/planet.png +0 -0
- data/res/generators/templates/application/public/icons/puzzle.png +0 -0
- data/res/generators/templates/application/public/icons/radar.png +0 -0
- data/res/generators/templates/application/public/icons/redo.png +0 -0
- data/res/generators/templates/application/public/icons/refresh.png +0 -0
- data/res/generators/templates/application/public/icons/runner.png +0 -0
- data/res/generators/templates/application/public/icons/shoebox.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
- data/res/generators/templates/application/public/icons/shuffle.png +0 -0
- data/res/generators/templates/application/public/icons/signpost.png +0 -0
- data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
- data/res/generators/templates/application/public/icons/skull.png +0 -0
- data/res/generators/templates/application/public/icons/sliders.png +0 -0
- data/res/generators/templates/application/public/icons/spraycan.png +0 -0
- data/res/generators/templates/application/public/icons/squiggle.png +0 -0
- data/res/generators/templates/application/public/icons/star.png +0 -0
- data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
- data/res/generators/templates/application/public/icons/suitcase.png +0 -0
- data/res/generators/templates/application/public/icons/tag.png +0 -0
- data/res/generators/templates/application/public/icons/tags.png +0 -0
- data/res/generators/templates/application/public/icons/target.png +0 -0
- data/res/generators/templates/application/public/icons/testtube.png +0 -0
- data/res/generators/templates/application/public/icons/thermometer.png +0 -0
- data/res/generators/templates/application/public/icons/toolbox.png +0 -0
- data/res/generators/templates/application/public/icons/trophy.png +0 -0
- data/res/generators/templates/application/public/icons/tshirt.png +0 -0
- data/res/generators/templates/application/public/icons/tv.png +0 -0
- data/res/generators/templates/application/public/icons/umbrella.png +0 -0
- data/res/generators/templates/application/public/icons/walk.png +0 -0
- data/res/generators/templates/application/public/icons/weather.png +0 -0
- data/res/generators/templates/application/public/icons/widescreen.png +0 -0
- data/res/generators/templates/application/public/icons/wineglass.png +0 -0
- data/res/generators/templates/application/public/icons/zap.png +0 -0
- data/res/generators/templates/application/public/js/jquery-1.2.6.min.js +0 -32
- data/res/generators/templates/model/config.rb +0 -3
- data/res/generators/templates/spec/app/spec/webview_spec.rb +0 -5
- data/spec/framework_spec/app/Account/config.rb +0 -59
- data/spec/framework_spec/app/Case/config.rb +0 -3
- data/spec/framework_spec/app/Customer/config.rb +0 -3
- data/spec/framework_spec/app/Product/config.rb +0 -17
data/lib/framework/rho/rho.rb
CHANGED
@@ -10,6 +10,12 @@ module Rho
|
|
10
10
|
def self.get_app
|
11
11
|
RHO.get_instance().get_app('app')
|
12
12
|
end
|
13
|
+
|
14
|
+
def self.file_exist?(fname)
|
15
|
+
return File.exist_injar?(fname) if defined? RHO_ME
|
16
|
+
|
17
|
+
File.exist?(fname)
|
18
|
+
end
|
13
19
|
|
14
20
|
class RHO
|
15
21
|
APPLICATIONS = {}
|
@@ -85,7 +91,7 @@ module Rho
|
|
85
91
|
|
86
92
|
def get_app(appname)
|
87
93
|
if (APPLICATIONS[appname].nil?)
|
88
|
-
require RhoApplication::get_app_path(appname)+'application'
|
94
|
+
require 'application' #RhoApplication::get_app_path(appname)+'application'
|
89
95
|
APPLICATIONS[appname] = Object.const_get('AppApplication').new
|
90
96
|
end
|
91
97
|
APPLICATIONS[appname]
|
@@ -96,8 +102,26 @@ module Rho
|
|
96
102
|
File.open(app_manifest_filename).each do |line|
|
97
103
|
str = line.chomp
|
98
104
|
if str != nil and str.length > 0
|
99
|
-
|
100
|
-
|
105
|
+
#puts "model file: #{str}"
|
106
|
+
modelName = File.basename(File.dirname(str))
|
107
|
+
Rhom::RhomObjectFactory.init_object(modelName)
|
108
|
+
require str
|
109
|
+
|
110
|
+
#puts "model name: #{modelName}"
|
111
|
+
|
112
|
+
modelClass = Object.const_get(modelName)
|
113
|
+
if modelClass
|
114
|
+
if modelClass.respond_to?( :get_model_params )
|
115
|
+
Rho::RhoConfig::add_source(modelName,modelClass.get_model_params())
|
116
|
+
modelClass.reset_model_params()
|
117
|
+
else
|
118
|
+
puts "ERROR: Invalid model definition. Add 'include Rhom::PropertyBag' or 'include Rhom::FixedSchema' to model class"
|
119
|
+
end
|
120
|
+
else
|
121
|
+
puts "ERROR: cannot load model : #{modelClass}"
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
101
125
|
end
|
102
126
|
end
|
103
127
|
|
@@ -134,6 +158,24 @@ module Rho
|
|
134
158
|
puts "load_server_sources : #{data}"
|
135
159
|
|
136
160
|
res = Rho::JSON.parse(data)
|
161
|
+
if res['partition']
|
162
|
+
str_partition = res['partition']
|
163
|
+
puts "reload sources for partition: #{str_partition}"
|
164
|
+
db = @db_partitions[ str_partition ]
|
165
|
+
|
166
|
+
puts "sources before: #{Rho::RhoConfig::sources()}"
|
167
|
+
|
168
|
+
Rho::RhoConfig::sources().delete_if {|key, value| value['partition']==str_partition }
|
169
|
+
arSrcs = db.select_from_table('sources','source_id, name, sync_priority, partition, sync_type, schema, schema_version, associations, blob_attribs',
|
170
|
+
{'partition'=>str_partition} )
|
171
|
+
arSrcs.each do |src|
|
172
|
+
Rho::RhoConfig::sources()[ src['name'] ] = src
|
173
|
+
end
|
174
|
+
|
175
|
+
puts "sources after: #{Rho::RhoConfig::sources()}"
|
176
|
+
return
|
177
|
+
end
|
178
|
+
|
137
179
|
arSrc = res['server_sources']
|
138
180
|
puts "arSrc: #{arSrc}"
|
139
181
|
return unless arSrc
|
@@ -177,20 +219,20 @@ module Rho
|
|
177
219
|
partition = source['partition']
|
178
220
|
@db_partitions[partition] = nil
|
179
221
|
|
180
|
-
if source['
|
181
|
-
source['
|
182
|
-
|
183
|
-
if !
|
184
|
-
|
222
|
+
if source['associations']
|
223
|
+
source['associations'].each do |src_name, attrib|
|
224
|
+
associationsSrc = find_src_byname(uniq_sources, src_name)
|
225
|
+
if !associationsSrc
|
226
|
+
puts ( "Error: associations from '#{source['name']}' : source name '#{src_name}' does not exist." )
|
185
227
|
next
|
186
228
|
end
|
187
229
|
|
188
|
-
|
189
|
-
|
190
|
-
|
230
|
+
str_associations = associationsSrc['str_associations']
|
231
|
+
str_associations = "" unless str_associations
|
232
|
+
str_associations += ',' if str_associations.length() > 0
|
191
233
|
|
192
|
-
|
193
|
-
|
234
|
+
str_associations += source['name'] + ',' + attrib
|
235
|
+
associationsSrc['str_associations'] = str_associations
|
194
236
|
end
|
195
237
|
end
|
196
238
|
end
|
@@ -232,7 +274,8 @@ module Rho
|
|
232
274
|
strCols += "\"#{col}\""
|
233
275
|
end
|
234
276
|
|
235
|
-
|
277
|
+
strIndName = "rhoIndex" + (is_unique ? "U" : "" ) + "_#{nInd}"
|
278
|
+
strIndex = "CREATE #{strUnique} INDEX \"#{strIndName}\" on #{src_name} (#{strCols});\r\n"
|
236
279
|
strRes += strIndex
|
237
280
|
nInd += 1
|
238
281
|
end
|
@@ -246,7 +289,6 @@ module Rho
|
|
246
289
|
puts 'init_schema_sources'
|
247
290
|
|
248
291
|
uniq_sources.each do |source|
|
249
|
-
puts "source : #{source}"
|
250
292
|
db = get_src_db(source['name'])
|
251
293
|
|
252
294
|
if source['schema'] && !db.table_exist?(source['name'])
|
@@ -309,18 +351,18 @@ module Rho
|
|
309
351
|
uniq_sources.each do |source|
|
310
352
|
puts "init_db_sources : #{source}"
|
311
353
|
name = source['name']
|
312
|
-
|
354
|
+
sync_priority = source['sync_priority']
|
313
355
|
partition = source['partition']
|
314
356
|
sync_type = source['sync_type']
|
315
357
|
schema_version = source['schema_version']
|
316
|
-
|
358
|
+
associations = source['str_associations']
|
317
359
|
blob_attribs = process_blob_attribs(source, db)
|
318
360
|
|
319
|
-
attribs = db.select_from_table('sources','
|
361
|
+
attribs = db.select_from_table('sources','sync_priority,source_id,partition, sync_type, schema_version, associations, blob_attribs', {'name'=>name})
|
320
362
|
|
321
363
|
if attribs && attribs.size > 0
|
322
|
-
if attribs[0]['
|
323
|
-
db.update_into_table('sources', {"
|
364
|
+
if attribs[0]['sync_priority'].to_i != sync_priority.to_i
|
365
|
+
db.update_into_table('sources', {"sync_priority"=>sync_priority},{"name"=>name})
|
324
366
|
end
|
325
367
|
if attribs[0]['sync_type'] != sync_type
|
326
368
|
db.update_into_table('sources', {"sync_type"=>sync_type},{"name"=>name})
|
@@ -331,8 +373,8 @@ module Rho
|
|
331
373
|
if attribs[0]['partition'] != partition
|
332
374
|
db.update_into_table('sources', {"partition"=>partition},{"name"=>name})
|
333
375
|
end
|
334
|
-
if attribs[0]['
|
335
|
-
db.update_into_table('sources', {"
|
376
|
+
if attribs[0]['associations'] != associations
|
377
|
+
db.update_into_table('sources', {"associations"=>associations},{"name"=>name})
|
336
378
|
end
|
337
379
|
if attribs[0]['blob_attribs'] != blob_attribs
|
338
380
|
db.update_into_table('sources', {"blob_attribs"=>blob_attribs},{"name"=>name})
|
@@ -352,8 +394,8 @@ module Rho
|
|
352
394
|
end
|
353
395
|
|
354
396
|
db.insert_into_table('sources',
|
355
|
-
{"source_id"=>source['source_id'],"name"=>name, "
|
356
|
-
"schema_version"=>source['schema_version'], '
|
397
|
+
{"source_id"=>source['source_id'],"name"=>name, "sync_priority"=>sync_priority, "sync_type"=>sync_type, "partition"=>partition,
|
398
|
+
"schema_version"=>source['schema_version'], 'associations'=>associations, 'blob_attribs'=>blob_attribs })
|
357
399
|
|
358
400
|
end
|
359
401
|
|
@@ -490,10 +532,10 @@ module Rho
|
|
490
532
|
err_page = nil
|
491
533
|
if exception && exception.is_a?(::Rhom::RecordNotFound)
|
492
534
|
err_page = RhoApplication::get_app_path(APPNAME) + 'E400_erb.iseq'
|
493
|
-
err_page = nil unless
|
535
|
+
err_page = nil unless ::Rho::file_exist?(err_page)
|
494
536
|
elsif exception
|
495
537
|
err_page = RhoApplication::get_app_path(APPNAME) + 'E500_erb.iseq'
|
496
|
-
err_page = nil unless
|
538
|
+
err_page = nil unless ::Rho::file_exist?(err_page)
|
497
539
|
end
|
498
540
|
|
499
541
|
if err_page
|
@@ -587,25 +629,23 @@ module Rho
|
|
587
629
|
def add_config(key,value)
|
588
630
|
@@config[key] = value if key # allow nil value
|
589
631
|
end
|
590
|
-
|
632
|
+
|
591
633
|
def add_source(modelname, new_source=nil)
|
592
634
|
return if !modelname || modelname.length() == 0# || @@sources[modelname]
|
593
635
|
|
594
|
-
@@sources[modelname] = new_source ? new_source : {}
|
636
|
+
@@sources[modelname] = new_source ? new_source.clone() : {}
|
595
637
|
@@sources[modelname]['name'] ||= modelname
|
596
|
-
@@sources[modelname]['
|
597
|
-
@@sources[modelname]['partition']
|
598
|
-
|
638
|
+
@@sources[modelname]['sync_priority'] ||= 1000
|
639
|
+
if @@sources[modelname]['partition']
|
640
|
+
@@sources[modelname]['partition'] = @@sources[modelname]['partition'].to_s
|
641
|
+
else
|
642
|
+
@@sources[modelname]['partition'] ||= 'user'
|
643
|
+
end
|
599
644
|
|
600
|
-
|
601
|
-
|
602
|
-
end
|
603
|
-
|
604
|
-
if @@sources[modelname]['sync'].nil?
|
605
|
-
@@sources[modelname]['sync'] = true
|
606
|
-
end
|
645
|
+
@@sources[modelname]['sync_type'] = 'none' if !@@sources[modelname]['sync']
|
646
|
+
@@sources[modelname]['sync_type'] ||= 'incremental'
|
607
647
|
|
608
|
-
@@max_config_srcid =
|
648
|
+
@@max_config_srcid = @@sources[modelname]['source_id'] if @@sources[modelname]['source_id'] && @@max_config_srcid < @@sources[modelname]['source_id']
|
609
649
|
end
|
610
650
|
|
611
651
|
@@g_base_temp_id = nil
|
@@ -626,6 +666,20 @@ module Rho
|
|
626
666
|
ret ? 1 : 0
|
627
667
|
end
|
628
668
|
|
669
|
+
def self.headers(args)
|
670
|
+
hdrs = args[:headers]
|
671
|
+
hdrs = {} if hdrs.nil?
|
672
|
+
|
673
|
+
if hdrs['User-Agent'].nil?
|
674
|
+
platform = System.get_property('platform')
|
675
|
+
device = System.get_property('device_name')
|
676
|
+
version = System.get_property('os_version')
|
677
|
+
hdrs['User-Agent'] = "Mozilla-5.0 (#{platform}; #{device}; #{version})"
|
678
|
+
end
|
679
|
+
|
680
|
+
hdrs
|
681
|
+
end
|
682
|
+
|
629
683
|
def self.process_result(res, callback)
|
630
684
|
return res if callback && callback.length() > 0
|
631
685
|
|
@@ -636,22 +690,22 @@ module Rho
|
|
636
690
|
|
637
691
|
def self.get(args)
|
638
692
|
process_result(
|
639
|
-
AsyncHttp.do_get(args[:url], args
|
693
|
+
AsyncHttp.do_get(args[:url], headers(args),
|
640
694
|
args[:callback], args[:callback_param], ssl_verify_peer(args) ), args[:callback] )
|
641
695
|
end
|
642
696
|
def self.post(args)
|
643
697
|
process_result(
|
644
|
-
AsyncHttp.do_post(args[:url], args
|
698
|
+
AsyncHttp.do_post(args[:url], headers(args), args[:body],
|
645
699
|
args[:callback], args[:callback_param], ssl_verify_peer(args) ), args[:callback] )
|
646
700
|
end
|
647
701
|
def self.download_file(args)
|
648
702
|
process_result(
|
649
|
-
AsyncHttp.do_downloadfile(args[:url], args
|
703
|
+
AsyncHttp.do_downloadfile(args[:url], headers(args), args[:filename],
|
650
704
|
args[:callback], args[:callback_param], ssl_verify_peer(args) ), args[:callback] )
|
651
705
|
end
|
652
706
|
def self.upload_file(args)
|
653
707
|
process_result(
|
654
|
-
AsyncHttp.do_uploadfile(args[:url], args[:
|
708
|
+
AsyncHttp.do_uploadfile(args[:url], headers(args), args[:body], args[:filename],
|
655
709
|
args[:callback], args[:callback_param], ssl_verify_peer(args) ), args[:callback] )
|
656
710
|
end
|
657
711
|
end
|
@@ -69,6 +69,11 @@ module Rho
|
|
69
69
|
def get_model_path(appname, modelname)
|
70
70
|
Rho::RhoFSConnector::get_model_path(appname, modelname)
|
71
71
|
end
|
72
|
+
|
73
|
+
def get_blob_path(relative_file_path)
|
74
|
+
File.join(__rhoGetCurrentDir(), relative_file_path)
|
75
|
+
end
|
76
|
+
|
72
77
|
end
|
73
78
|
|
74
79
|
def serve(req,res)
|
@@ -76,10 +81,10 @@ module Rho
|
|
76
81
|
controller_class = req['model']+'Controller'
|
77
82
|
undercase = controller_class.split(/(?=[A-Z])/).map{|w| w.downcase}.join("_")
|
78
83
|
|
79
|
-
if
|
80
|
-
require req[:modelpath]+ undercase
|
84
|
+
if Rho::file_exist?( req[:modelpath]+ undercase +'.iseq' )
|
85
|
+
require req['model'] + '/' + undercase #req[:modelpath]+ undercase
|
81
86
|
else
|
82
|
-
require req[:modelpath]+'controller'
|
87
|
+
require req['model'] + '/controller' #req[:modelpath]+'controller'
|
83
88
|
end
|
84
89
|
|
85
90
|
res['request-body'] = (Object.const_get(req['model']+'Controller').new).send :serve, self, @rhom, req, res
|
@@ -56,7 +56,7 @@ module Rho
|
|
56
56
|
res = send req['action'].nil? ? default_action : req['action']
|
57
57
|
else
|
58
58
|
called_action = @request['action'].nil? ? default_action : @request['action']
|
59
|
-
unless
|
59
|
+
unless Rho::file_exist?(@request[:modelpath]+called_action.to_s+'_erb.iseq')
|
60
60
|
rho_error( "Action '#{act}' does not exist in controller or has private access." )
|
61
61
|
res = render :string => "<font size=\"+4\"><h2>404 Not Found.</h2>The action <i>#{called_action}</i> does not have a view or a controller</font>"
|
62
62
|
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
require 'version
|
1
|
+
require 'version'
|
2
2
|
$rhodeslib = File.dirname(__FILE__)
|
data/lib/framework/rhodes.rb
CHANGED
@@ -1,28 +1,11 @@
|
|
1
1
|
begin
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
require 'rational'
|
10
|
-
#require 'date/format'
|
11
|
-
#require 'time'
|
12
|
-
|
13
|
-
# require 'sqlite3/constants'
|
14
|
-
# require 'sqlite3/errors'
|
15
|
-
# require 'sqlite3/pragmas'
|
3
|
+
if defined? RHO_ME
|
4
|
+
require 'rationalME'
|
5
|
+
else
|
6
|
+
require 'rational'
|
7
|
+
end
|
16
8
|
|
17
|
-
# require 'sqlite3/resultset'
|
18
|
-
# require 'sqlite3/statement'
|
19
|
-
|
20
|
-
# require 'date'
|
21
|
-
# require 'sqlite3/translator'
|
22
|
-
|
23
|
-
# require 'sqlite3/value'
|
24
|
-
|
25
|
-
# require 'sqlite3/database'
|
26
9
|
require 'rhom/rhom_db_adapter'
|
27
10
|
|
28
11
|
require 'rhom/rhom_object'
|
@@ -35,6 +18,8 @@ begin
|
|
35
18
|
|
36
19
|
require 'rho/rhoapplication'
|
37
20
|
|
21
|
+
require 'indifferent_access'
|
22
|
+
require 'rho/rhosupport'
|
38
23
|
require 'rho/rhocontroller'
|
39
24
|
require 'rho/render'
|
40
25
|
|
@@ -1 +1 @@
|
|
1
|
-
require 'rho/rhofsconnector
|
1
|
+
require 'rho/rhofsconnector'
|
@@ -29,13 +29,13 @@ module LocalizationSimplified
|
|
29
29
|
|
30
30
|
if check_exist
|
31
31
|
begin
|
32
|
-
require file + curLocale if
|
32
|
+
require file + curLocale if Rho::file_exist?(file + curLocale + '.iseq')
|
33
33
|
rescue Exception => e
|
34
34
|
puts 'Could not load resources for locale: ' + curLocale.to_s
|
35
35
|
if curLocale != 'en'
|
36
36
|
begin
|
37
37
|
puts 'Load english resources.'
|
38
|
-
require file + 'en' if
|
38
|
+
require file + 'en' if Rho::file_exist?(file + 'en.iseq')
|
39
39
|
rescue Exception => e
|
40
40
|
end
|
41
41
|
end
|
data/lib/framework/rhom/rhom.rb
CHANGED
@@ -148,10 +148,10 @@ class RhomDbAdapter
|
|
148
148
|
if value.nil? or value == 'NULL'
|
149
149
|
"NULL"
|
150
150
|
elsif value.is_a?(String)
|
151
|
-
s = value.gsub(
|
151
|
+
s = value.gsub(/'/,"''")
|
152
152
|
"'#{s}'"
|
153
153
|
else
|
154
|
-
s = value.to_s.gsub(
|
154
|
+
s = value.to_s.gsub(/'/,"''")
|
155
155
|
"'#{s}'"
|
156
156
|
end
|
157
157
|
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
|
2
|
+
module Rhom
|
3
|
+
|
4
|
+
module BaseModel
|
5
|
+
class << self
|
6
|
+
attr_accessor :model_params
|
7
|
+
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_model_params
|
11
|
+
BaseModel.model_params
|
12
|
+
end
|
13
|
+
|
14
|
+
def reset_model_params
|
15
|
+
BaseModel.model_params = {}
|
16
|
+
end
|
17
|
+
|
18
|
+
def fixed_schema?
|
19
|
+
false
|
20
|
+
end
|
21
|
+
|
22
|
+
def property(name,type=:string)
|
23
|
+
BaseModel.model_params ||= {}
|
24
|
+
|
25
|
+
if type == :blob
|
26
|
+
BaseModel.model_params['blob_attribs'] ||= []
|
27
|
+
BaseModel.model_params['blob_attribs'] << name.to_s
|
28
|
+
end
|
29
|
+
|
30
|
+
if fixed_schema?
|
31
|
+
BaseModel.model_params['schema'] ||= {}
|
32
|
+
BaseModel.model_params['schema']['columns'] ||= []
|
33
|
+
|
34
|
+
BaseModel.model_params['schema']['columns'] << name.to_s
|
35
|
+
#TODO: type support
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def set(name,value)
|
41
|
+
BaseModel.model_params ||= {}
|
42
|
+
BaseModel.model_params[name.to_s] = value
|
43
|
+
end
|
44
|
+
|
45
|
+
def enable(name)
|
46
|
+
set(name,true)
|
47
|
+
end
|
48
|
+
|
49
|
+
def belongs_to(name, owner)
|
50
|
+
BaseModel.model_params ||= {}
|
51
|
+
BaseModel.model_params['associations'] ||= {}
|
52
|
+
|
53
|
+
BaseModel.model_params['associations'][owner.to_s] = name.to_s
|
54
|
+
end
|
55
|
+
|
56
|
+
def index(*args)
|
57
|
+
return unless fixed_schema?
|
58
|
+
|
59
|
+
BaseModel.model_params['schema'] ||= {}
|
60
|
+
BaseModel.model_params['schema']['indexes'] ||= []
|
61
|
+
|
62
|
+
BaseModel.model_params['schema']['indexes'] << args
|
63
|
+
end
|
64
|
+
|
65
|
+
def unique_index(*args)
|
66
|
+
return unless fixed_schema?
|
67
|
+
|
68
|
+
BaseModel.model_params['schema'] ||= {}
|
69
|
+
BaseModel.model_params['schema']['unique_indexes'] ||= []
|
70
|
+
|
71
|
+
BaseModel.model_params['schema']['unique_indexes'] << args
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
76
|
+
module FixedSchema
|
77
|
+
include BaseModel
|
78
|
+
|
79
|
+
def self.included(model)
|
80
|
+
model.extend FixedSchema
|
81
|
+
end
|
82
|
+
|
83
|
+
def fixed_schema?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
module PropertyBag
|
90
|
+
include BaseModel
|
91
|
+
|
92
|
+
def self.included(model)
|
93
|
+
model.extend PropertyBag
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
end # Rhom
|
@@ -18,23 +18,23 @@
|
|
18
18
|
# You should have received a copy of the GNU General Public License
|
19
19
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
20
20
|
#
|
21
|
-
require 'rhom'
|
22
|
-
require 'rho'
|
23
|
-
require 'rho/rhosupport'
|
21
|
+
#require 'rhom'
|
22
|
+
#require 'rho'
|
23
|
+
#require 'rho/rhosupport'
|
24
24
|
|
25
25
|
module Rhom
|
26
26
|
|
27
27
|
class RhomObjectFactory
|
28
28
|
|
29
29
|
def initialize
|
30
|
-
|
31
|
-
|
32
|
-
end
|
30
|
+
#unless not defined? Rho::RhoConfig.sources
|
31
|
+
# init_objects
|
32
|
+
#end
|
33
33
|
end
|
34
34
|
|
35
35
|
# Initialize new object with dynamic attributes
|
36
|
-
def
|
37
|
-
Rho::RhoConfig.sources.each do |classname,source|
|
36
|
+
def self.init_object(classname)
|
37
|
+
#Rho::RhoConfig.sources.each do |classname,source|
|
38
38
|
unless Object.const_defined?(classname.intern)
|
39
39
|
Object.const_set(classname.intern,
|
40
40
|
Class.new do
|
@@ -1070,9 +1070,10 @@ module Rhom
|
|
1070
1070
|
end
|
1071
1071
|
end)
|
1072
1072
|
end #unless
|
1073
|
-
modelname = classname.split(/(?=[A-Z])/).map{|w| w.downcase}.join("_")
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1073
|
+
#modelname = classname.split(/(?=[A-Z])/).map{|w| w.downcase}.join("_")
|
1074
|
+
#puts "classname: #{classname}; modelname: #{modelname}"
|
1075
|
+
#require "#{classname}/#{modelname}" if File.exists? File.join(Rho::RhoFSConnector.get_base_app_path,'app',classname,"#{modelname}.iseq")
|
1076
|
+
#end
|
1077
|
+
end #init_object
|
1077
1078
|
end # RhomObjectFactory
|
1078
1079
|
end # Rhom
|
data/lib/rhodes.rb
CHANGED
@@ -4,11 +4,11 @@
|
|
4
4
|
#include <assert.h>
|
5
5
|
#include <stdlib.h>
|
6
6
|
|
7
|
+
#include <rhodes.h>
|
8
|
+
|
7
9
|
#include <ruby.h>
|
8
10
|
#include <ruby/ext/rho/rhoruby.h>
|
9
11
|
|
10
|
-
#include <jni.h>
|
11
|
-
|
12
12
|
#include <common/RhoDefs.h>
|
13
13
|
#include <logging/RhoLogConf.h>
|
14
14
|
#include <logging/RhoLog.h>
|
@@ -17,11 +17,10 @@
|
|
17
17
|
|
18
18
|
JavaVM *jvm();
|
19
19
|
void store_thr_jnienv(JNIEnv *env);
|
20
|
-
JNIEnv *jnienv();
|
21
20
|
|
22
21
|
enum rho_java_class_t {
|
23
22
|
#define RHODES_DEFINE_JAVA_CLASS(x, name) x,
|
24
|
-
#include <details/rhojava.inc>
|
23
|
+
#include <rhodes/details/rhojava.inc>
|
25
24
|
#undef RHODES_DEFINE_JAVA_CLASS
|
26
25
|
};
|
27
26
|
|
@@ -36,56 +35,6 @@ jmethodID getJNIClassStaticMethod(JNIEnv *env, jclass cls, const char *name, con
|
|
36
35
|
|
37
36
|
VALUE convertJavaMapToRubyHash(jobject objMap);
|
38
37
|
|
39
|
-
namespace details
|
40
|
-
{
|
41
|
-
|
42
|
-
template <typename T, typename U>
|
43
|
-
struct rho_cast_helper;
|
44
|
-
|
45
|
-
template <>
|
46
|
-
struct rho_cast_helper<std::string, jstring>
|
47
|
-
{
|
48
|
-
std::string operator()(JNIEnv *env, jstring );
|
49
|
-
};
|
50
|
-
|
51
|
-
template <>
|
52
|
-
struct rho_cast_helper<jstring, char const *>
|
53
|
-
{
|
54
|
-
jstring operator()(JNIEnv *env, char const *);
|
55
|
-
};
|
56
|
-
|
57
|
-
template <>
|
58
|
-
struct rho_cast_helper<jstring, char *>
|
59
|
-
{
|
60
|
-
jstring operator()(JNIEnv *env, char *s) {return rho_cast_helper<jstring, char const *>()(env, s);}
|
61
|
-
};
|
62
|
-
|
63
|
-
template <int N>
|
64
|
-
struct rho_cast_helper<jstring, char [N]>
|
65
|
-
{
|
66
|
-
jstring operator()(JNIEnv *env, char (&s)[N]) {return rho_cast_helper<jstring, char const *>()(env, &s[0]);}
|
67
|
-
};
|
68
|
-
|
69
|
-
template <>
|
70
|
-
struct rho_cast_helper<jstring, std::string>
|
71
|
-
{
|
72
|
-
jstring operator()(JNIEnv *env, std::string const &s) {return rho_cast_helper<jstring, char const *>()(env, s.c_str());}
|
73
|
-
};
|
74
|
-
|
75
|
-
} // namespace details
|
76
|
-
|
77
|
-
template <typename T, typename U>
|
78
|
-
T rho_cast(JNIEnv *env, U u)
|
79
|
-
{
|
80
|
-
return details::rho_cast_helper<T, U>()(env, u);
|
81
|
-
}
|
82
|
-
|
83
|
-
template <typename T, typename U>
|
84
|
-
T rho_cast(U u)
|
85
|
-
{
|
86
|
-
return details::rho_cast_helper<T, U>()(jnienv(), u);
|
87
|
-
}
|
88
|
-
|
89
38
|
#define RHO_NOT_IMPLEMENTED RAWLOG_ERROR3("WARNING: Call not implemented function: \"%s\" (defined here: %s:%d)", __PRETTY_FUNCTION__, __FILE__, __LINE__)
|
90
39
|
|
91
40
|
//#define RHO_LOG_CALLBACK RAWLOG_INFO1("Callback \"%s\" called", __PRETTY_FUNCTION__)
|
File without changes
|
File without changes
|
@@ -18,6 +18,7 @@ RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_MAP, "java/util/Map")
|
|
18
18
|
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_MAPVIEW, "com/rhomobile/rhodes/mapview/MapView")
|
19
19
|
#endif // RHO_GOOGLE_API_KEY
|
20
20
|
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_NATIVEBAR, "com/rhomobile/rhodes/NativeBar")
|
21
|
+
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_NAVBAR, "com/rhomobile/rhodes/NavBar")
|
21
22
|
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_PHONEBOOK, "com/rhomobile/rhodes/phonebook/Phonebook")
|
22
23
|
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_RHODES, "com/rhomobile/rhodes/Rhodes")
|
23
24
|
RHODES_DEFINE_JAVA_CLASS(RHODES_JAVA_CLASS_RHOSOCKADDR, "com/rhomobile/rhodes/socket/RhoSockAddr")
|
File without changes
|
File without changes
|
data/platform/android/Rhodes/jni/include/{jni → rhodes/jni}/com_rhomobile_rhodes_RhoLogConf.h
RENAMED
File without changes
|
File without changes
|