rhodes 6.2.0 → 7.1.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +14 -10
- data/appveyor.yml +1 -1
- data/extensions/emdk3-manager/ext/platform/android/Rakefile +2 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +18 -1
- data/extensions/rhoelementsext/ext/rhoelementsext/platform/android/Rakefile +19 -1
- data/lib/commonAPI/RubyServer/ext.yml +21 -0
- data/lib/commonAPI/RubyServer/ext/RubyServer.xml +101 -0
- data/lib/commonAPI/RubyServer/ext/build +19 -0
- data/lib/commonAPI/RubyServer/ext/build.bat +29 -0
- data/lib/commonAPI/RubyServer/ext/platform/android/Rakefile +161 -0
- data/lib/commonAPI/RubyServer/ext/platform/android/ext_java.files +9 -0
- data/lib/commonAPI/RubyServer/ext/platform/android/ext_native.files +7 -0
- data/lib/commonAPI/RubyServer/ext/platform/iphone/Rakefile +73 -0
- data/lib/commonAPI/RubyServer/ext/platform/iphone/RubyServer.xcodeproj/project.pbxproj +322 -0
- data/lib/commonAPI/RubyServer/ext/platform/iphone/RubyServer_Prefix.pch +7 -0
- data/lib/commonAPI/RubyServer/ext/shared/RubyServerImpl.cpp +242 -0
- data/lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeFactory.java +23 -3
- data/lib/commonAPI/barcode/ext/platform/android/src/com/rho/barcode/BarcodeRhoExtension.java +68 -8
- data/lib/commonAPI/barcode/ext/platform/iphone/Barcode.xcodeproj/project.pbxproj +24 -52
- data/lib/commonAPI/barcode/ext/platform/iphone/Classes/BarcodeViewController.h +38 -10
- data/lib/commonAPI/barcode/ext/platform/iphone/Classes/BarcodeViewController.m +300 -22
- data/lib/commonAPI/barcode/ext/platform/iphone/Classes/BarcodeViewFactory.mm +6 -0
- data/lib/commonAPI/barcode/ext/platform/iphone/Classes/barcode.m +6 -2
- data/lib/commonAPI/barcode/ext/platform/iphone/impl/Barcode.m +7 -3
- data/lib/commonAPI/barcode/ext/platform/iphone/impl/BarcodeFactory.m +13 -0
- data/lib/commonAPI/barcode/ext/platform/iphone/impl/BarcodeSingleton.m +25 -3
- data/lib/commonAPI/bluetooth/ext/platform/android/Rakefile +29 -10
- data/lib/commonAPI/clipboard/ext/platform/android/Rakefile +29 -10
- data/lib/commonAPI/coreapi/ext/Notification.xml +47 -0
- data/lib/commonAPI/coreapi/ext/platform/android/ApplicationManifestAdds.erb +1 -0
- data/lib/commonAPI/coreapi/ext/platform/android/Rakefile +19 -0
- data/lib/commonAPI/coreapi/ext/platform/android/ext_java.files +2 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/AlarmReceiver.java +27 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/Notification.java +28 -10
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationFactory.java +14 -1
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationScheduler.java +260 -0
- data/lib/commonAPI/coreapi/ext/platform/android/src/com/rho/notification/NotificationSingleton.java +23 -1
- data/lib/commonAPI/coreapi/ext/platform/iphone/Coreapi.xcodeproj/project.pbxproj +21 -19
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.h +1 -0
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NotificationSingleton.m +234 -1
- data/lib/commonAPI/coreapi/ext/platform/qt/coreapi.pro +2 -0
- data/lib/commonAPI/coreapi/ext/platform/qt/src/CNotificationImpl.cpp +7 -0
- data/lib/commonAPI/coreapi/ext/shared/ApplicationImpl.cpp +5 -0
- data/lib/commonAPI/coreapi/public/api/rhoapi.js +18 -8
- data/lib/commonAPI/devicesecurity/ext/platform/android/Rakefile +19 -0
- data/lib/commonAPI/devicesecurity/ext/platform/iphone/DeviceSecurity.xcodeproj/project.pbxproj +16 -0
- data/lib/commonAPI/hardwarekeys/ext/keycapture.xml +11 -9
- data/lib/commonAPI/hardwarekeys/ext/platform/iphone/impl/KeyCaptureSingleton.h +5 -3
- data/lib/commonAPI/hardwarekeys/ext/platform/iphone/impl/KeyCaptureSingleton.m +80 -67
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraEclair.java +25 -14
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraGingerbread.java +55 -25
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/CameraObject.java +34 -9
- data/lib/commonAPI/mediacapture/ext/platform/android/src/com/rho/camera/ICameraObject.java +1 -0
- data/lib/commonAPI/printing_zebra/ext/platform/android/Rakefile +18 -0
- data/lib/commonAPI/sensor/ext/platform/android/src/com/rho/sensor/Sensor.java +4 -4
- data/lib/extensions/decrypt/ext/platform/android/Rakefile +19 -1
- data/lib/extensions/decryptstub/ext/platform/android/Rakefile +19 -0
- data/lib/extensions/decryptstub/ext/platform/iphone/Decryptstub.xcodeproj/project.pbxproj +4 -2
- data/lib/extensions/digest-md5/ext/android/Rakefile +18 -0
- data/lib/extensions/digest-sha1/ext/android/Rakefile +18 -0
- data/lib/extensions/digest-sha2/ext/android/Rakefile +18 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +19 -19
- data/lib/extensions/fcm-push/ext/android/Rakefile +18 -0
- data/lib/extensions/fcm-push/ext/android/src/com/rhomobile/rhodes/fcm/FCMIntentService.java +38 -16
- data/lib/extensions/gcm-push/ext/android/Rakefile +19 -0
- data/lib/extensions/keyboard/ext.yml +15 -0
- data/lib/extensions/keyboard/ext/Keyboard.xml +28 -0
- data/lib/extensions/keyboard/ext/build +19 -0
- data/lib/extensions/keyboard/ext/build.bat +29 -0
- data/lib/extensions/keyboard/ext/platform/android/Rakefile +141 -0
- data/lib/extensions/keyboard/ext/platform/android/ext_java.files +9 -0
- data/lib/extensions/keyboard/ext/platform/android/ext_native.files +7 -0
- data/lib/extensions/keyboard/ext/platform/android/jni/Keyboard_impl.cpp +61 -0
- data/lib/extensions/keyboard/ext/platform/android/src/com/rho/keyboard/Keyboard.java +32 -0
- data/lib/extensions/keyboard/ext/platform/android/src/com/rho/keyboard/KeyboardFactory.java +18 -0
- data/lib/extensions/keyboard/ext/platform/android/src/com/rho/keyboard/KeyboardSingleton.java +29 -0
- data/lib/extensions/keyboard/ext/platform/iphone/Keyboard.xcodeproj/project.pbxproj +368 -0
- data/lib/extensions/keyboard/ext/platform/iphone/Keyboard_Prefix.pch +7 -0
- data/lib/extensions/keyboard/ext/platform/iphone/Rakefile +73 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/Keyboard.h +14 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/Keyboard.m +24 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/KeyboardFactorySingleton.m +16 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/KeyboardSetup.m +9 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/KeyboardSingleton.h +17 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/KeyboardSingleton.m +23 -0
- data/lib/extensions/keyboard/ext/platform/iphone/impl/readme.txt +7 -0
- data/lib/extensions/keyboard/ext/platform/qt/Keyboard.pro +68 -0
- data/lib/extensions/keyboard/ext/platform/qt/Makefile +473 -0
- data/lib/extensions/keyboard/ext/platform/qt/Makefile.Release +408 -0
- data/lib/extensions/keyboard/ext/platform/qt/Rakefile +39 -0
- data/lib/extensions/keyboard/ext/platform/qt/src/Keyboard_impl.cpp +99 -0
- data/lib/extensions/keyboard/ext/platform/uwp/Keyboard.props +18 -0
- data/lib/extensions/keyboard/ext/platform/uwp/Keyboard.vcxproj +197 -0
- data/lib/extensions/keyboard/ext/platform/uwp/Keyboard.vcxproj.filters +50 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardImpl.csproj +119 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardImpl.props +8 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardImpl.targets +7 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardLib.props +18 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardLib.vcxproj +197 -0
- data/lib/extensions/keyboard/ext/platform/uwp/KeyboardLib.vcxproj.filters +58 -0
- data/lib/extensions/keyboard/ext/platform/uwp/src/Keyboard_impl.cpp +76 -0
- data/lib/extensions/keyboard/ext/platform/uwp/src/Keyboard_impl.cs +69 -0
- data/lib/extensions/keyboard/ext/platform/uwp/src/Properties/AssemblyInfo.cs +37 -0
- data/lib/extensions/keyboard/ext/platform/wm/Keyboard.sln +52 -0
- data/lib/extensions/keyboard/ext/platform/wm/Keyboard.vcproj +714 -0
- data/lib/extensions/keyboard/ext/platform/wm/Keyboard.vsprops +15 -0
- data/lib/extensions/keyboard/ext/platform/wm/src/Keyboard_impl.cpp +77 -0
- data/lib/extensions/openssl.so.src/ext/android/Rakefile +18 -0
- data/lib/extensions/openssl.so/ext/android/aarch64/libopenssl.so.a +0 -0
- data/lib/extensions/openssl.so/ext/iphone/OpenSSl.SDK/howtobuild.txt +2 -0
- data/lib/extensions/openssl.so/ext/iphone/OpenSSl.SDK/libcrypto.a +0 -0
- data/lib/extensions/openssl.so/ext/iphone/OpenSSl.SDK/libssl.a +0 -0
- data/lib/extensions/openssl.so/ext/iphone/Release-iphoneos/libopenssl.so.a +0 -0
- data/lib/extensions/openssl.so/ext/iphone/Release-iphonesimulator/libopenssl.so.a +0 -0
- data/lib/extensions/openssl/ext/android/Rakefile +18 -0
- data/lib/extensions/zlib/ext/zlib.c +5 -1
- data/lib/framework/autocomplete/Rhodes.rb +1 -1
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/set.rb +799 -0
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml.erb +11 -2
- data/platform/android/Rhodes/jni/include/rhodes.h +6 -0
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +3 -0
- data/platform/android/Rhodes/jni/include/rhodes/SecurityTokenGenerator.h +30 -0
- data/platform/android/Rhodes/jni/include/rhodes/details/rhojava.inc +1 -0
- data/platform/android/Rhodes/jni/src/JNIRhoRubyCppWrapper.cpp +408 -0
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +7 -0
- data/platform/android/Rhodes/jni/src/SecurityTokenGenerator.cpp +60 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +318 -12
- data/platform/android/Rhodes/jni/src/mapview.cpp +4 -0
- data/platform/android/Rhodes/res/drawable/ic_notification.png +0 -0
- data/platform/android/Rhodes/res/xml/network_security_config.xml +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +9 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMain.java +8 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoRubyArrayObjects.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoRubyClassObject.java +20 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoRubyObject.java +115 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoRubySingleton.java +52 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoRubyTypes.java +15 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +25 -13
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SecurityTokenGenerator.java +57 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/extmanager/RhoExtManagerImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +9 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +7 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality11.java +13 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality26.java +105 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +4 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +24 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +20 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +10 -0
- data/platform/android/build/Rakefile +30 -1
- data/platform/android/build/RhodesSRC_build.files +8 -0
- data/platform/android/build/android.rake +326 -22
- data/platform/android/build/android_tools.rb +36 -3
- data/platform/android/build/androidcommon.rb +97 -44
- data/platform/android/build/librhocommon_build.files +11 -0
- data/platform/android/build/librhodes_build.files +2 -0
- data/platform/android/build/manifest_generator.rb +9 -2
- data/platform/android/build/maven_deps_extractor.rb +96 -15
- data/platform/android/build/ndkwrapper.rb +111 -16
- data/platform/android/build/pom.erb +2 -2
- data/platform/iphone/Classes/AppManager/AppManager.m +31 -1
- data/platform/iphone/Classes/MapView/GoogleGeocoder.h +3 -3
- data/platform/iphone/Classes/RhoMainViewStubImpl.h +38 -0
- data/platform/iphone/Classes/RhoMainViewStubImpl.m +88 -0
- data/platform/iphone/Classes/RhoUIWebView.h +5 -0
- data/platform/iphone/Classes/RhoUIWebView.m +14 -6
- data/platform/iphone/Classes/{RhoWKWebView.m → RhoWKWebView.mm} +98 -18
- data/platform/iphone/Classes/RhoWebView.h +1 -1
- data/platform/iphone/Classes/RhoWebViewFabrique.m +24 -12
- data/platform/iphone/Classes/Rhodes.h +7 -2
- data/platform/iphone/Classes/Rhodes.m +46 -8
- data/platform/iphone/Classes/SimpleMainView.m +22 -13
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +32 -3
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +93 -61
- data/platform/iphone/Classes/URLProtocol/CRhoWKURLProtocol.h +22 -0
- data/platform/iphone/Classes/URLProtocol/CRhoWKURLProtocol.m +246 -0
- data/platform/iphone/Classes/WebView.m +14 -2
- data/platform/iphone/Entitlements.plist +1 -1
- data/platform/iphone/Framework/RhoApplication/RhoApplication.xcodeproj/project.pbxproj +399 -0
- data/platform/iphone/Framework/Rhodes/Rhodes.xcodeproj/project.pbxproj +1208 -0
- data/platform/iphone/Framework/Rhodes/Rhodes/Info.plist +24 -0
- data/platform/iphone/Framework/Rhodes/Rhodes/Rhodes.h +21 -0
- data/platform/iphone/Framework/Rhodes/Rhodes/StubCode.m +15 -0
- data/platform/iphone/Info.plist +1 -3
- data/platform/iphone/RhoAppBaseLib/RhoAppBaseLib.xcodeproj/project.pbxproj +511 -4
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +467 -1
- data/platform/iphone/Rhodes.xcodeproj/project.pbxproj +51 -274
- data/platform/iphone/RhodesBaseDelegate.h +1 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +85 -3
- data/platform/iphone/rbuild/ApplicationPlist.erb +1 -1
- data/platform/iphone/rbuild/iphone.rake +497 -25
- data/platform/iphone/rbuild/iphonecommon.rb +15 -6
- data/platform/iphone/rhodes_stub.cpp +15 -0
- data/platform/iphone/rhodeslib/api/RhodesLib.h +28 -0
- data/platform/iphone/rhodeslib/impl/RhodesLib.m +52 -0
- data/platform/iphone/rhodesruby/api/IRefCountedObject.h +20 -0
- data/platform/iphone/rhodesruby/api/IRhoRuby.h +72 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyArray.h +12 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyBoolean.h +11 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyFloat.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyHash.h +15 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyInteger.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableArray.h +9 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableBoolean.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableFloat.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableHash.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableInteger.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyMutableString.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyNativeCallback.h +9 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyNil.h +10 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyObject.h +37 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyRunnable.h +8 -0
- data/platform/iphone/rhodesruby/api/IRhoRubyString.h +10 -0
- data/platform/iphone/rhodesruby/api/RhoRuby.h +26 -0
- data/platform/iphone/rhodesruby/api/RhoRubySingletone.h +14 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyFabrique.h +10 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyImpl.h +56 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyImpl.mm +432 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableArrayImpl.h +24 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableArrayImpl.mm +43 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableBooleanImpl.h +23 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableBooleanImpl.mm +38 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableFloatImpl.h +23 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableFloatImpl.mm +35 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableHashImpl.h +24 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableHashImpl.mm +48 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableIntegerImpl.h +23 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableIntegerImpl.mm +35 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableStringImpl.h +23 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyMutableStringImpl.mm +35 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyNilImpl.h +22 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyNilImpl.mm +11 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyObjectImpl.h +31 -0
- data/platform/iphone/rhodesruby/impl/RhoRubyObjectImpl.mm +49 -0
- data/platform/iphone/rhodesruby/impl/RhoRubySingletone.m +19 -0
- data/platform/iphone/rhodesruby/impl/RubyServerResponceImpl.h +21 -0
- data/platform/iphone/rhodesruby/impl/RubyServerResponceImpl.mm +32 -0
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +79 -0
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +91 -0
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +85 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app.zip +0 -0
- data/platform/shared/common/IRhoClassFactory.h +2 -0
- data/platform/shared/common/ISecurityTokenGenerator.h +16 -0
- data/platform/shared/common/RhoFile.cpp +11 -0
- data/platform/shared/common/RhoMath.h +14 -0
- data/platform/shared/common/RhoMutexLock.h +13 -0
- data/platform/shared/common/RhoSystem.h +1 -1
- data/platform/shared/common/RhoThread.cpp +25 -0
- data/platform/shared/common/RhodesApp.cpp +52 -6
- data/platform/shared/common/RhodesApp.h +25 -1
- data/platform/shared/common/RhodesAppBase.cpp +4 -2
- data/platform/shared/common/RhodesAppBase.h +5 -0
- data/platform/shared/common/iphone/RhoClassfactory.h +6 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +21 -2
- data/platform/shared/common/map/BaseMapEngine.cpp +2 -2
- data/platform/shared/common/map/GeocodingMapEngine.cpp +1 -1
- data/platform/shared/common/map/GoogleMapEngine.cpp +1 -1
- data/platform/shared/common/map/OSMMapEngine.cpp +1 -1
- data/platform/shared/curl/lib/curl_config.h +28 -0
- data/platform/shared/db/DBAdapter.cpp +18 -10
- data/platform/shared/json.new/JSONIterator.cpp +2 -2
- data/platform/shared/net/HttpServer.cpp +32 -0
- data/platform/shared/net/HttpServer.h +15 -0
- data/platform/shared/net/INetRequest.cpp +54 -0
- data/platform/shared/qt/RhoRubylib.pro +10 -0
- data/platform/shared/qt/rhodes/impl/AlertImpl.cpp +13 -0
- data/platform/shared/qt/rhodes/impl/CameraImpl.cpp +6 -0
- data/platform/shared/qt/rhodes/impl/DateTimePickerImpl.cpp +4 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +36 -7
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +12 -1
- data/platform/shared/qt/rhodes/impl/NativeTabbarImpl.cpp +21 -2
- data/platform/shared/qt/rhodes/impl/NativeTabbarImpl.h +1 -0
- data/platform/shared/qt/rhodes/impl/NativeToolbarImpl.cpp +10 -0
- data/platform/shared/qt/rhodes/impl/QtSystemImpl.cpp +55 -3
- data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.h +11 -0
- data/platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp +71 -7
- data/platform/shared/qt/rhodes/impl/RhoThreadImpl.h +79 -2
- data/platform/shared/qt/rhodes/impl/RhodesImpl.cpp +16 -6
- data/platform/shared/qt/rhodes/impl/SecurityTokenGeneratorImpl.cpp +37 -0
- data/platform/shared/qt/rhodes/impl/SecurityTokenGeneratorImpl.h +25 -0
- data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +2 -0
- data/platform/shared/qt/rhodes/impl/WebViewImpl.cpp +27 -0
- data/platform/shared/qt/rhodes/impl/notificationsound.cpp +16 -2
- data/platform/shared/qt/rhodes/impl/notificationsound.h +11 -1
- data/platform/shared/qt/rhodes/newVersion/QtMainWindow.cpp +25 -16
- data/platform/shared/qt/rhodes/newVersion/QtMainWindow.h +3 -0
- data/platform/shared/qt/rhodes/newVersion/WebUrlRequestInterceptor.cpp +17 -0
- data/platform/shared/qt/rhodes/rhodes.pro +68 -14
- data/platform/shared/qt/rhodes/rhorubyVersion/rhodeslib.cpp +148 -0
- data/platform/shared/qt/rhodes/rhorubyVersion/rhodeslib.h +12 -0
- data/platform/shared/qt/rholib/rholib.pro +33 -5
- data/platform/shared/qt/rhoruby_win32_build.bat +19 -0
- data/platform/shared/qt/rhoruby_win32_build_debug.bat +19 -0
- data/platform/shared/qt/rhosimulator_win32_build_debug.bat +19 -0
- data/platform/shared/qt/rubylib/rubylib.pro +1 -0
- data/platform/shared/qt/sqlite3/sqlite3.pro +1 -0
- data/platform/shared/qt/syncengine/syncengine.pro +1 -0
- data/platform/shared/rhoruby/api/IArray.h +20 -0
- data/platform/shared/rhoruby/api/IBoolean.h +17 -0
- data/platform/shared/rhoruby/api/IFloat.h +17 -0
- data/platform/shared/rhoruby/api/IHash.h +23 -0
- data/platform/shared/rhoruby/api/IInteger.h +18 -0
- data/platform/shared/rhoruby/api/IMutableArray.h +18 -0
- data/platform/shared/rhoruby/api/IMutableBoolean.h +18 -0
- data/platform/shared/rhoruby/api/IMutableFloat.h +17 -0
- data/platform/shared/rhoruby/api/IMutableHash.h +18 -0
- data/platform/shared/rhoruby/api/IMutableInteger.h +17 -0
- data/platform/shared/rhoruby/api/IMutableString.h +17 -0
- data/platform/shared/rhoruby/api/INil.h +16 -0
- data/platform/shared/rhoruby/api/IObject.h +46 -0
- data/platform/shared/rhoruby/api/IRefCountedObject.h +20 -0
- data/platform/shared/rhoruby/api/IRhoRuby.h +78 -0
- data/platform/shared/rhoruby/api/IRunnable.h +17 -0
- data/platform/shared/rhoruby/api/IString.h +17 -0
- data/platform/shared/rhoruby/api/RhoRuby.h +29 -0
- data/platform/shared/rhoruby/api/RhoRubySingletone.h +19 -0
- data/platform/shared/rhoruby/api/SmartPointer.h +27 -0
- data/platform/shared/rhoruby/impl/MutableArrayImpl.cpp +54 -0
- data/platform/shared/rhoruby/impl/MutableArrayImpl.h +48 -0
- data/platform/shared/rhoruby/impl/MutableBooleanImpl.cpp +44 -0
- data/platform/shared/rhoruby/impl/MutableBooleanImpl.h +44 -0
- data/platform/shared/rhoruby/impl/MutableFloatImpl.cpp +41 -0
- data/platform/shared/rhoruby/impl/MutableFloatImpl.h +44 -0
- data/platform/shared/rhoruby/impl/MutableHashImpl.cpp +64 -0
- data/platform/shared/rhoruby/impl/MutableHashImpl.h +49 -0
- data/platform/shared/rhoruby/impl/MutableIntegerImpl.cpp +41 -0
- data/platform/shared/rhoruby/impl/MutableIntegerImpl.h +44 -0
- data/platform/shared/rhoruby/impl/MutableStringImpl.cpp +52 -0
- data/platform/shared/rhoruby/impl/MutableStringImpl.h +44 -0
- data/platform/shared/rhoruby/impl/NilImpl.cpp +23 -0
- data/platform/shared/rhoruby/impl/NilImpl.h +32 -0
- data/platform/shared/rhoruby/impl/ObjectImpl.cpp +77 -0
- data/platform/shared/rhoruby/impl/ObjectImpl.h +53 -0
- data/platform/shared/rhoruby/impl/RefCountedObjectImpl.cpp +28 -0
- data/platform/shared/rhoruby/impl/RefCountedObjectImpl.h +33 -0
- data/platform/shared/rhoruby/impl/RhoRubyImpl.cpp +799 -0
- data/platform/shared/rhoruby/impl/RhoRubyImpl.h +81 -0
- data/platform/shared/rhoruby/impl/RhoRubySingletone.cpp +20 -0
- data/platform/shared/rhoruby/impl/RubyServerResponceImpl.cpp +32 -0
- data/platform/shared/rhoruby/impl/RubyServerResponceImpl.h +21 -0
- data/platform/shared/ruby/android/ruby/config.h +55 -3
- data/platform/shared/ruby/error.c +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +60 -7
- data/platform/shared/ruby/ext/rho/rhoruby.h +3 -0
- data/platform/shared/rubyext/NativeToolbarExt.h +1 -0
- data/platform/uwp/rhodes/rhodes_TemporaryKey.pfx +0 -0
- data/platform/uwp/rhoruntime/common/RhoClassFactory.h +6 -0
- data/platform/win32/RhoSimulator/Qt5Core.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Gui.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Multimedia.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Network.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Positioning.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5PrintSupport.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Qml.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Quick.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5QuickWidgets.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5SerialPort.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Svg.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5WebChannel.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5WebEngine.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5WebEngineCore.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5WebEngineWidgets.dll +0 -0
- data/platform/win32/RhoSimulator/Qt5Widgets.dll +0 -0
- data/platform/win32/RhoSimulator/QtWebEngineProcess.exe +0 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/RhoSimulator/audio/qtaudio_wasapi.dll +0 -0
- data/platform/win32/RhoSimulator/audio/qtaudio_windows.dll +0 -0
- data/platform/win32/RhoSimulator/bearer/qgenericbearer.dll +0 -0
- data/platform/win32/RhoSimulator/iconengines/qsvgicon.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qgif.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qicns.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qico.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qjpeg.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qsvg.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtga.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qtiff.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qwbmp.dll +0 -0
- data/platform/win32/RhoSimulator/imageformats/qwebp.dll +0 -0
- data/platform/win32/RhoSimulator/libEGL.dll +0 -0
- data/platform/win32/RhoSimulator/libGLESV2.dll +0 -0
- data/platform/win32/RhoSimulator/mediaservice/dsengine.dll +0 -0
- data/platform/win32/RhoSimulator/mediaservice/qtmedia_audioengine.dll +0 -0
- data/platform/win32/RhoSimulator/mediaservice/wmfengine.dll +0 -0
- data/platform/win32/RhoSimulator/platforms/qwindows.dll +0 -0
- data/platform/win32/RhoSimulator/playlistformats/qtmultimedia_m3u.dll +0 -0
- data/platform/win32/RhoSimulator/position/qtposition_geoclue.dll +0 -0
- data/platform/win32/RhoSimulator/position/qtposition_positionpoll.dll +0 -0
- data/platform/win32/RhoSimulator/position/qtposition_serialnmea.dll +0 -0
- data/platform/win32/RhoSimulator/position/qtposition_winrt.dll +0 -0
- data/platform/win32/RhoSimulator/printsupport/windowsprintersupport.dll +0 -0
- data/platform/wm/build/wm.rake +110 -5
- data/platform/wm/rhodes/rho/common/ExtManager.cpp +30 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +6 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +3 -0
- data/platform/wm/rubylib/rubylib.vcxproj +6 -0
- data/platform/wp8/rhoruntime/common/RhoClassFactory.h +6 -0
- data/rakefile.rb +14 -10
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +23 -15
- data/res/build-tools/maven/LICENSE +18 -89
- data/res/build-tools/maven/NOTICE +1 -1
- data/res/build-tools/maven/README.txt +12 -12
- data/res/build-tools/maven/bin/m2.conf +2 -2
- data/res/build-tools/maven/bin/mvn +122 -125
- data/res/build-tools/maven/bin/mvn.cmd +205 -0
- data/res/build-tools/maven/bin/mvnDebug +10 -176
- data/res/build-tools/maven/bin/mvnDebug.cmd +33 -0
- data/res/build-tools/maven/bin/mvnyjp +9 -181
- data/res/build-tools/maven/boot/plexus-classworlds-2.6.0.jar +0 -0
- data/res/build-tools/maven/conf/logging/simplelogger.properties +8 -1
- data/res/build-tools/maven/conf/settings.xml +1 -1
- data/res/build-tools/maven/conf/toolchains.xml +103 -0
- data/res/build-tools/maven/lib/animal-sniffer-annotations-1.14.jar +0 -0
- data/res/build-tools/maven/lib/animal-sniffer-annotations.license +14 -0
- data/res/build-tools/maven/lib/checker-compat-qual-2.0.0.jar +0 -0
- data/res/build-tools/maven/lib/checker-compat-qual.license +14 -0
- data/res/build-tools/maven/lib/commons-cli-1.4.jar +0 -0
- data/res/build-tools/maven/lib/commons-io-2.5.jar +0 -0
- data/res/build-tools/maven/lib/commons-lang3-3.8.1.jar +0 -0
- data/res/build-tools/maven/lib/error_prone_annotations-2.1.3.jar +0 -0
- data/res/build-tools/maven/lib/guava-25.1-android.jar +0 -0
- data/res/build-tools/maven/lib/guice-4.2.1-no_aop.jar +0 -0
- data/res/build-tools/maven/lib/j2objc-annotations-1.1.jar +0 -0
- data/res/build-tools/maven/lib/jansi-1.17.1.jar +0 -0
- data/res/build-tools/maven/lib/jansi-native/README.txt +7 -0
- data/res/build-tools/maven/lib/jansi-native/freebsd32/libjansi.so +0 -0
- data/res/build-tools/maven/lib/jansi-native/freebsd64/libjansi.so +0 -0
- data/res/build-tools/maven/lib/jansi-native/linux32/libjansi.so +0 -0
- data/res/build-tools/maven/lib/jansi-native/linux64/libjansi.so +0 -0
- data/res/build-tools/maven/lib/jansi-native/osx/libjansi.jnilib +0 -0
- data/res/build-tools/maven/lib/jansi-native/windows32/jansi.dll +0 -0
- data/res/build-tools/maven/lib/jansi-native/windows64/jansi.dll +0 -0
- data/res/build-tools/maven/lib/jcl-over-slf4j-1.7.25.jar +0 -0
- data/res/build-tools/maven/lib/jcl-over-slf4j.license +14 -0
- data/res/build-tools/maven/lib/jsr250-api.license +383 -405
- data/res/build-tools/maven/lib/jsr305-3.0.2.jar +0 -0
- data/res/build-tools/maven/lib/maven-artifact-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-builder-support-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-compat-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-core-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-embedder-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-model-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-model-builder-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-plugin-api-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-repository-metadata-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-api-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-connector-basic-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-impl-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-provider-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-spi-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-transport-wagon-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-resolver-util-1.3.3.jar +0 -0
- data/res/build-tools/maven/lib/maven-settings-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-settings-builder-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-shared-utils-3.2.1.jar +0 -0
- data/res/build-tools/maven/lib/maven-slf4j-provider-3.6.1.jar +0 -0
- data/res/build-tools/maven/lib/org.eclipse.sisu.inject-0.3.3.jar +0 -0
- data/res/build-tools/maven/lib/org.eclipse.sisu.inject.license +210 -261
- data/res/build-tools/maven/lib/org.eclipse.sisu.plexus-0.3.3.jar +0 -0
- data/res/build-tools/maven/lib/org.eclipse.sisu.plexus.license +210 -261
- data/res/build-tools/maven/lib/plexus-component-annotations-1.7.1.jar +0 -0
- data/res/build-tools/maven/lib/plexus-interpolation-1.25.jar +0 -0
- data/res/build-tools/maven/lib/plexus-sec-dispatcher-1.4.jar +0 -0
- data/res/build-tools/maven/lib/plexus-utils-3.2.0.jar +0 -0
- data/res/build-tools/maven/lib/slf4j-api-1.7.25.jar +0 -0
- data/res/build-tools/maven/lib/slf4j-api.license +10 -186
- data/res/build-tools/maven/lib/wagon-file-3.3.2.jar +0 -0
- data/res/build-tools/maven/lib/wagon-http-3.3.2-shaded.jar +0 -0
- data/res/build-tools/maven/lib/wagon-provider-api-3.3.2.jar +0 -0
- data/res/generators/rhogen.rb +150 -0
- data/res/generators/templates/application/AndroidManifest.erb +13 -4
- data/res/generators/templates/application/build.yml +9 -0
- data/res/generators/templates/application/nodejs_build.yml +1 -1
- data/res/generators/templates/application/resources/android/res/xml/network_security_config.xml +7 -0
- data/res/generators/templates/application/rhoconfig.txt +13 -6
- data/res/generators/templates/application/rhoconfig_rubynode.txt +139 -0
- data/res/generators/templates/application/rubynodejs_build.yml +95 -0
- data/res/generators/templates/extension/extensions/montana/ext/platform/android/Rakefile +19 -0
- data/res/generators/templates/iphone_project/root/Entitlements.plist +1 -1
- data/res/generators/templates/iphone_project/root/Info.plist +1 -3
- data/res/generators/templates/iphone_project/root/rhorunner_development.entitlements +1 -1
- data/res/generators/templates/iphone_project/root/rhorunner_production.entitlements +1 -1
- data/rhodes.gemspec +2 -2
- data/version +1 -1
- metadata +244 -71
- data/res/build-tools/maven/bin/mvn.bat +0 -197
- data/res/build-tools/maven/bin/mvnDebug.bat +0 -200
- data/res/build-tools/maven/boot/plexus-classworlds-2.5.2.jar +0 -0
- data/res/build-tools/maven/lib/aether-api-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-api.license +0 -261
- data/res/build-tools/maven/lib/aether-connector-basic-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-connector-basic.license +0 -261
- data/res/build-tools/maven/lib/aether-impl-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-impl.license +0 -261
- data/res/build-tools/maven/lib/aether-spi-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-spi.license +0 -261
- data/res/build-tools/maven/lib/aether-transport-wagon-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-transport-wagon.license +0 -261
- data/res/build-tools/maven/lib/aether-util-1.0.0.v20140518.jar +0 -0
- data/res/build-tools/maven/lib/aether-util.license +0 -261
- data/res/build-tools/maven/lib/cdi-api.license +0 -445
- data/res/build-tools/maven/lib/commons-cli-1.2.jar +0 -0
- data/res/build-tools/maven/lib/commons-io-2.2.jar +0 -0
- data/res/build-tools/maven/lib/commons-lang-2.6.jar +0 -0
- data/res/build-tools/maven/lib/guava-18.0.jar +0 -0
- data/res/build-tools/maven/lib/jsoup-1.7.2.jar +0 -0
- data/res/build-tools/maven/lib/jsoup.license +0 -66
- data/res/build-tools/maven/lib/maven-aether-provider-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-aether-provider.license +0 -202
- data/res/build-tools/maven/lib/maven-artifact-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-artifact.license +0 -202
- data/res/build-tools/maven/lib/maven-compat-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-compat.license +0 -202
- data/res/build-tools/maven/lib/maven-core-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-core.license +0 -202
- data/res/build-tools/maven/lib/maven-embedder-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-embedder.license +0 -202
- data/res/build-tools/maven/lib/maven-model-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-model-builder-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-model-builder.license +0 -202
- data/res/build-tools/maven/lib/maven-model.license +0 -202
- data/res/build-tools/maven/lib/maven-plugin-api-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-plugin-api.license +0 -202
- data/res/build-tools/maven/lib/maven-repository-metadata-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-repository-metadata.license +0 -202
- data/res/build-tools/maven/lib/maven-settings-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-settings-builder-3.2.5.jar +0 -0
- data/res/build-tools/maven/lib/maven-settings-builder.license +0 -202
- data/res/build-tools/maven/lib/maven-settings.license +0 -202
- data/res/build-tools/maven/lib/org.eclipse.sisu.inject-0.3.0.M1.jar +0 -0
- data/res/build-tools/maven/lib/org.eclipse.sisu.plexus-0.3.0.M1.jar +0 -0
- data/res/build-tools/maven/lib/plexus-cipher.license +0 -445
- data/res/build-tools/maven/lib/plexus-component-annotations-1.5.5.jar +0 -0
- data/res/build-tools/maven/lib/plexus-interpolation-1.21.jar +0 -0
- data/res/build-tools/maven/lib/plexus-sec-dispatcher-1.3.jar +0 -0
- data/res/build-tools/maven/lib/plexus-sec-dispatcher.license +0 -445
- data/res/build-tools/maven/lib/plexus-utils-3.0.20.jar +0 -0
- data/res/build-tools/maven/lib/sisu-guice-3.2.3-no_aop.jar +0 -0
- data/res/build-tools/maven/lib/slf4j-api-1.7.5.jar +0 -0
- data/res/build-tools/maven/lib/slf4j-simple-1.7.5.jar +0 -0
- data/res/build-tools/maven/lib/slf4j-simple.license +0 -190
- data/res/build-tools/maven/lib/wagon-file-2.8.jar +0 -0
- data/res/build-tools/maven/lib/wagon-file.license +0 -202
- data/res/build-tools/maven/lib/wagon-http-2.8-shaded.jar +0 -0
- data/res/build-tools/maven/lib/wagon-http-shared-2.8.jar +0 -0
- data/res/build-tools/maven/lib/wagon-http-shared.license +0 -202
- data/res/build-tools/maven/lib/wagon-http.license +0 -202
- data/res/build-tools/maven/lib/wagon-provider-api-2.8.jar +0 -0
- data/res/build-tools/maven/lib/wagon-provider-api.license +0 -202
@@ -0,0 +1,15 @@
|
|
1
|
+
<?xml version="1.0" encoding="windows-1251"?>
|
2
|
+
<VisualStudioPropertySheet
|
3
|
+
ProjectType="Visual C++"
|
4
|
+
Version="8.00"
|
5
|
+
Name="emmlapi"
|
6
|
+
>
|
7
|
+
<UserMacro
|
8
|
+
Name="RHO_ROOT_DEMO"
|
9
|
+
Value="c:\projects\rhodes"
|
10
|
+
/>
|
11
|
+
<UserMacro
|
12
|
+
Name="TEMP_FILES_DIR_DEMO"
|
13
|
+
Value="$(RHO_ROOT)\platform\wm\bin\$(PlatformName)\extensions\$(ProjectName)"
|
14
|
+
/>
|
15
|
+
</VisualStudioPropertySheet>
|
@@ -0,0 +1,77 @@
|
|
1
|
+
#include "../../../shared/generated/cpp/KeyboardBase.h"
|
2
|
+
|
3
|
+
namespace rho {
|
4
|
+
|
5
|
+
using namespace apiGenerator;
|
6
|
+
|
7
|
+
class CKeyboardImpl: public CKeyboardBase
|
8
|
+
{
|
9
|
+
public:
|
10
|
+
CKeyboardImpl(const rho::String& strID): CKeyboardBase()
|
11
|
+
{
|
12
|
+
}
|
13
|
+
|
14
|
+
virtual void getPlatformName(rho::apiGenerator::CMethodResult& oResult) {
|
15
|
+
oResult.set("WM");
|
16
|
+
}
|
17
|
+
|
18
|
+
virtual void calcSumm( int a, int b, rho::apiGenerator::CMethodResult& oResult) {
|
19
|
+
oResult.set(a+b);
|
20
|
+
}
|
21
|
+
|
22
|
+
virtual void joinStrings( const rho::String& a, const rho::String& b, rho::apiGenerator::CMethodResult& oResult) {
|
23
|
+
oResult.set(a+b);
|
24
|
+
}
|
25
|
+
|
26
|
+
};
|
27
|
+
|
28
|
+
class CKeyboardSingleton: public CKeyboardSingletonBase
|
29
|
+
{
|
30
|
+
~CKeyboardSingleton(){}
|
31
|
+
virtual rho::String getInitialDefaultID();
|
32
|
+
virtual void enumerate(CMethodResult& oResult);
|
33
|
+
};
|
34
|
+
|
35
|
+
class CKeyboardFactory: public CKeyboardFactoryBase
|
36
|
+
{
|
37
|
+
~CKeyboardFactory(){}
|
38
|
+
virtual IKeyboardSingleton* createModuleSingleton();
|
39
|
+
virtual IKeyboard* createModuleByID(const rho::String& strID);
|
40
|
+
};
|
41
|
+
|
42
|
+
extern "C" void Init_Keyboard_extension()
|
43
|
+
{
|
44
|
+
CKeyboardFactory::setInstance( new CKeyboardFactory() );
|
45
|
+
Init_Keyboard_API();
|
46
|
+
}
|
47
|
+
|
48
|
+
IKeyboard* CKeyboardFactory::createModuleByID(const rho::String& strID)
|
49
|
+
{
|
50
|
+
return new CKeyboardImpl(strID);
|
51
|
+
}
|
52
|
+
|
53
|
+
IKeyboardSingleton* CKeyboardFactory::createModuleSingleton()
|
54
|
+
{
|
55
|
+
return new CKeyboardSingleton();
|
56
|
+
}
|
57
|
+
|
58
|
+
void CKeyboardSingleton::enumerate(CMethodResult& oResult)
|
59
|
+
{
|
60
|
+
rho::Vector<rho::String> arIDs;
|
61
|
+
arIDs.addElement("SC1");
|
62
|
+
arIDs.addElement("SC2");
|
63
|
+
|
64
|
+
oResult.set(arIDs);
|
65
|
+
}
|
66
|
+
|
67
|
+
rho::String CKeyboardSingleton::getInitialDefaultID()
|
68
|
+
{
|
69
|
+
CMethodResult oRes;
|
70
|
+
enumerate(oRes);
|
71
|
+
|
72
|
+
rho::Vector<rho::String>& arIDs = oRes.getStringArray();
|
73
|
+
|
74
|
+
return arIDs[0];
|
75
|
+
}
|
76
|
+
|
77
|
+
}
|
@@ -44,20 +44,24 @@ ARGS = [
|
|
44
44
|
OBJDIR_ARM = File.join(OBJDIR,'arm')
|
45
45
|
OBJDIR_x86 = File.join(OBJDIR,'x86')
|
46
46
|
OBJDIR_MIPS = File.join(OBJDIR,'mips')
|
47
|
+
OBJDIR_AARCH64 = File.join(OBJDIR,'aarch64')
|
47
48
|
|
48
49
|
SRC = get_sources File.join($curdir, 'ext_native.files')
|
49
50
|
|
50
51
|
OBJ_ARM = FileList.new(get_objects(SRC, OBJDIR_ARM))
|
51
52
|
OBJ_x86 = FileList.new(get_objects(SRC, OBJDIR_x86))
|
52
53
|
OBJ_MIPS = FileList.new(get_objects(SRC, OBJDIR_MIPS))
|
54
|
+
OBJ_AARCH64 = FileList.new(get_objects(SRC, OBJDIR_AARCH64))
|
53
55
|
|
54
56
|
TARGETDIR_ARM = File.join(TARGETDIR,'armeabi')
|
55
57
|
TARGETDIR_x86 = File.join(TARGETDIR,'x86')
|
56
58
|
TARGETDIR_MIPS = File.join(TARGETDIR,'mips')
|
59
|
+
TARGETDIR_AARCH64 = File.join(TARGETDIR,'aarch64')
|
57
60
|
|
58
61
|
TARGETLIB_ARM = File.join(TARGETDIR_ARM,'libopenssl.so.a')
|
59
62
|
TARGETLIB_x86 = File.join(TARGETDIR_x86,'libopenssl.so.a')
|
60
63
|
TARGETLIB_MIPS = File.join(TARGETDIR_MIPS,'libopenssl.so.a')
|
64
|
+
TARGETLIB_AARCH64 = File.join(TARGETDIR_AARCH64,'libopenssl.so.a')
|
61
65
|
|
62
66
|
cd "#{$rootdir}/lib/extensions/openssl.so"
|
63
67
|
|
@@ -73,14 +77,20 @@ namespace 'config' do
|
|
73
77
|
task :mips do
|
74
78
|
setup_ndk(ENV['ANDROID_NDK'],ENV['ANDROID_API_LEVEL'],'mips')
|
75
79
|
end
|
80
|
+
|
81
|
+
task :aarch64 do
|
82
|
+
setup_ndk(ENV['ANDROID_NDK'],ENV['ANDROID_API_LEVEL'],'aarch64')
|
83
|
+
end
|
76
84
|
end
|
77
85
|
|
78
86
|
directory TARGETDIR_ARM
|
79
87
|
directory TARGETDIR_x86
|
80
88
|
directory TARGETDIR_MIPS
|
89
|
+
directory TARGETDIR_AARCH64
|
81
90
|
directory OBJDIR_ARM
|
82
91
|
directory OBJDIR_x86
|
83
92
|
directory OBJDIR_MIPS
|
93
|
+
directory OBJDIR_AARCH64
|
84
94
|
|
85
95
|
rule '.o' => lambda {|obj| find_source(obj) } do |t|
|
86
96
|
abi = File.basename(File.dirname(t.name))
|
@@ -91,6 +101,7 @@ end
|
|
91
101
|
task OBJ_ARM => OBJDIR_ARM
|
92
102
|
task OBJ_x86 => OBJDIR_x86
|
93
103
|
task OBJ_MIPS => OBJDIR_MIPS
|
104
|
+
task OBJ_AARCH64 => OBJDIR_AARCH64
|
94
105
|
|
95
106
|
def find_source(objfile)
|
96
107
|
base = File.basename(objfile, '.o')
|
@@ -116,10 +127,17 @@ file TARGETLIB_MIPS => TARGETDIR_MIPS do |t|
|
|
116
127
|
end
|
117
128
|
multitask TARGETLIB_MIPS => OBJ_MIPS
|
118
129
|
|
130
|
+
file TARGETLIB_AARCH64 => TARGETDIR_AARCH64 do |t|
|
131
|
+
Rake::Task["config:aarch64"].invoke
|
132
|
+
cc_ar t.name, OBJ_AARCH64 or raise "\e[31mCreating library failed: #{t.name}\e[0m"
|
133
|
+
end
|
134
|
+
multitask TARGETLIB_AARCH64 => OBJ_AARCH64
|
135
|
+
|
119
136
|
namespace 'arch' do
|
120
137
|
task :arm => [TARGETLIB_ARM]
|
121
138
|
task :x86 => [TARGETLIB_x86]
|
122
139
|
task :mips => [TARGETLIB_MIPS]
|
140
|
+
task :aarch64 => [TARGETLIB_AARCH64]
|
123
141
|
end
|
124
142
|
|
125
143
|
task :default => ["arch:arm", "arch:x86"]
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -25,20 +25,24 @@ ARGS = ['-Iext',
|
|
25
25
|
OBJDIR_ARM = File.join(OBJDIR,'arm')
|
26
26
|
OBJDIR_x86 = File.join(OBJDIR,'x86')
|
27
27
|
OBJDIR_MIPS = File.join(OBJDIR,'mips')
|
28
|
+
OBJDIR_AARCH64 = File.join(OBJDIR,'aarch64')
|
28
29
|
|
29
30
|
SRC = get_sources File.join($curdir, 'ext_native.files')
|
30
31
|
|
31
32
|
OBJ_ARM = FileList.new(get_objects(SRC, OBJDIR_ARM))
|
32
33
|
OBJ_x86 = FileList.new(get_objects(SRC, OBJDIR_x86))
|
33
34
|
OBJ_MIPS = FileList.new(get_objects(SRC, OBJDIR_MIPS))
|
35
|
+
OBJ_AARCH64 = FileList.new(get_objects(SRC, OBJDIR_AARCH64))
|
34
36
|
|
35
37
|
TARGETDIR_ARM = File.join(TARGETDIR,'armeabi')
|
36
38
|
TARGETDIR_x86 = File.join(TARGETDIR,'x86')
|
37
39
|
TARGETDIR_MIPS = File.join(TARGETDIR,'mips')
|
40
|
+
TARGETDIR_AARCH64 = File.join(TARGETDIR,'aarch64')
|
38
41
|
|
39
42
|
TARGETLIB_ARM = File.join(TARGETDIR_ARM,'libopenssl.a')
|
40
43
|
TARGETLIB_x86 = File.join(TARGETDIR_x86,'libopenssl.a')
|
41
44
|
TARGETLIB_MIPS = File.join(TARGETDIR_MIPS,'libopenssl.a')
|
45
|
+
TARGETLIB_AARCH64 = File.join(TARGETDIR_AARCH64,'libopenssl.a')
|
42
46
|
|
43
47
|
cd '../..'
|
44
48
|
|
@@ -54,14 +58,20 @@ namespace 'config' do
|
|
54
58
|
task :mips do
|
55
59
|
setup_ndk(ENV['ANDROID_NDK'],ENV['ANDROID_API_LEVEL'],'mips')
|
56
60
|
end
|
61
|
+
|
62
|
+
task :aarch64 do
|
63
|
+
setup_ndk(ENV['ANDROID_NDK'],ENV['ANDROID_API_LEVEL'],'aarch64')
|
64
|
+
end
|
57
65
|
end
|
58
66
|
|
59
67
|
directory TARGETDIR_ARM
|
60
68
|
directory TARGETDIR_x86
|
61
69
|
directory TARGETDIR_MIPS
|
70
|
+
directory TARGETDIR_AARCH64
|
62
71
|
directory OBJDIR_ARM
|
63
72
|
directory OBJDIR_x86
|
64
73
|
directory OBJDIR_MIPS
|
74
|
+
directory OBJDIR_AARCH64
|
65
75
|
|
66
76
|
rule '.o' => lambda {|obj| find_source(obj) } do |t|
|
67
77
|
abi = File.basename(File.dirname(t.name))
|
@@ -72,6 +82,7 @@ end
|
|
72
82
|
task OBJ_ARM => OBJDIR_ARM
|
73
83
|
task OBJ_x86 => OBJDIR_x86
|
74
84
|
task OBJ_MIPS => OBJDIR_MIPS
|
85
|
+
task OBJ_AARCH64 => OBJDIR_AARCH64
|
75
86
|
|
76
87
|
def find_source(objfile)
|
77
88
|
base = File.basename(objfile, '.o')
|
@@ -97,10 +108,17 @@ file TARGETLIB_MIPS => TARGETDIR_MIPS do |t|
|
|
97
108
|
end
|
98
109
|
multitask TARGETLIB_MIPS => OBJ_MIPS
|
99
110
|
|
111
|
+
file TARGETLIB_AARCH64 => TARGETDIR_AARCH64 do |t|
|
112
|
+
Rake::Task["config:aarch64"].invoke
|
113
|
+
cc_ar t.name, OBJ_AARCH64 or raise "\e[31mCreating library failed: #{t.name}\e[0m"
|
114
|
+
end
|
115
|
+
multitask TARGETLIB_AARCH64 => OBJ_AARCH64
|
116
|
+
|
100
117
|
namespace 'arch' do
|
101
118
|
task :arm => [TARGETLIB_ARM]
|
102
119
|
task :x86 => [TARGETLIB_x86]
|
103
120
|
task :mips => [TARGETLIB_MIPS]
|
121
|
+
task :aarch64 => [TARGETLIB_AARCH64]
|
104
122
|
end
|
105
123
|
|
106
124
|
task :default => ["arch:arm", "arch:x86"]
|
@@ -507,7 +507,11 @@ rb_zlib_crc_table(VALUE obj)
|
|
507
507
|
{
|
508
508
|
#if !defined(HAVE_TYPE_Z_CRC_T)
|
509
509
|
/* z_crc_t is defined since zlib-1.2.7. */
|
510
|
+
#ifdef __aarch64__
|
511
|
+
typedef uint32_t z_crc_t;
|
512
|
+
#else
|
510
513
|
typedef unsigned long z_crc_t;
|
514
|
+
#endif
|
511
515
|
#endif
|
512
516
|
const z_crc_t *crctbl;
|
513
517
|
VALUE dst;
|
@@ -517,7 +521,7 @@ rb_zlib_crc_table(VALUE obj)
|
|
517
521
|
dst = rb_ary_new2(256);
|
518
522
|
|
519
523
|
for (i = 0; i < 256; i++) {
|
520
|
-
|
524
|
+
rb_ary_push(dst, rb_uint2inum(crctbl[i]));
|
521
525
|
}
|
522
526
|
return dst;
|
523
527
|
}
|
data/lib/framework/rhodes.rb
CHANGED
@@ -0,0 +1,799 @@
|
|
1
|
+
#--
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# set.rb - defines the Set class
|
5
|
+
#++
|
6
|
+
# Copyright (c) 2002-2013 Akinori MUSHA <knu@iDaemons.org>
|
7
|
+
#
|
8
|
+
# Documentation by Akinori MUSHA and Gavin Sinclair.
|
9
|
+
#
|
10
|
+
# All rights reserved. You can redistribute and/or modify it under the same
|
11
|
+
# terms as Ruby.
|
12
|
+
#
|
13
|
+
# $Id$
|
14
|
+
#
|
15
|
+
# == Overview
|
16
|
+
#
|
17
|
+
# This library provides the Set class, which deals with a collection
|
18
|
+
# of unordered values with no duplicates. It is a hybrid of Array's
|
19
|
+
# intuitive inter-operation facilities and Hash's fast lookup. If you
|
20
|
+
# need to keep values sorted in some order, use the SortedSet class.
|
21
|
+
#
|
22
|
+
# The method +to_set+ is added to Enumerable for convenience.
|
23
|
+
#
|
24
|
+
# See the Set and SortedSet documentation for examples of usage.
|
25
|
+
|
26
|
+
|
27
|
+
#
|
28
|
+
# Set implements a collection of unordered values with no duplicates.
|
29
|
+
# This is a hybrid of Array's intuitive inter-operation facilities and
|
30
|
+
# Hash's fast lookup.
|
31
|
+
#
|
32
|
+
# Set is easy to use with Enumerable objects (implementing +each+).
|
33
|
+
# Most of the initializer methods and binary operators accept generic
|
34
|
+
# Enumerable objects besides sets and arrays. An Enumerable object
|
35
|
+
# can be converted to Set using the +to_set+ method.
|
36
|
+
#
|
37
|
+
# Set uses Hash as storage, so you must note the following points:
|
38
|
+
#
|
39
|
+
# * Equality of elements is determined according to Object#eql? and
|
40
|
+
# Object#hash.
|
41
|
+
# * Set assumes that the identity of each element does not change
|
42
|
+
# while it is stored. Modifying an element of a set will render the
|
43
|
+
# set to an unreliable state.
|
44
|
+
# * When a string is to be stored, a frozen copy of the string is
|
45
|
+
# stored instead unless the original string is already frozen.
|
46
|
+
#
|
47
|
+
# == Comparison
|
48
|
+
#
|
49
|
+
# The comparison operators <, >, <= and >= are implemented as
|
50
|
+
# shorthand for the {proper_,}{subset?,superset?} methods. However,
|
51
|
+
# the <=> operator is intentionally left out because not every pair of
|
52
|
+
# sets is comparable. ({x,y} vs. {x,z} for example)
|
53
|
+
#
|
54
|
+
# == Example
|
55
|
+
#
|
56
|
+
# require 'set'
|
57
|
+
# s1 = Set.new [1, 2] # -> #<Set: {1, 2}>
|
58
|
+
# s2 = [1, 2].to_set # -> #<Set: {1, 2}>
|
59
|
+
# s1 == s2 # -> true
|
60
|
+
# s1.add("foo") # -> #<Set: {1, 2, "foo"}>
|
61
|
+
# s1.merge([2, 6]) # -> #<Set: {1, 2, "foo", 6}>
|
62
|
+
# s1.subset? s2 # -> false
|
63
|
+
# s2.subset? s1 # -> true
|
64
|
+
#
|
65
|
+
# == Contact
|
66
|
+
#
|
67
|
+
# - Akinori MUSHA <knu@iDaemons.org> (current maintainer)
|
68
|
+
#
|
69
|
+
class Set
|
70
|
+
include Enumerable
|
71
|
+
|
72
|
+
# Creates a new set containing the given objects.
|
73
|
+
def self.[](*ary)
|
74
|
+
new(ary)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Creates a new set containing the elements of the given enumerable
|
78
|
+
# object.
|
79
|
+
#
|
80
|
+
# If a block is given, the elements of enum are preprocessed by the
|
81
|
+
# given block.
|
82
|
+
def initialize(enum = nil, &block) # :yields: o
|
83
|
+
@hash ||= Hash.new(false)
|
84
|
+
|
85
|
+
enum.nil? and return
|
86
|
+
|
87
|
+
if block
|
88
|
+
do_with_enum(enum) { |o| add(block[o]) }
|
89
|
+
else
|
90
|
+
merge(enum)
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def do_with_enum(enum, &block) # :nodoc:
|
95
|
+
if enum.respond_to?(:each_entry)
|
96
|
+
enum.each_entry(&block) if block
|
97
|
+
elsif enum.respond_to?(:each)
|
98
|
+
enum.each(&block) if block
|
99
|
+
else
|
100
|
+
raise ArgumentError, "value must be enumerable"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
private :do_with_enum
|
104
|
+
|
105
|
+
# Dup internal hash.
|
106
|
+
def initialize_dup(orig)
|
107
|
+
super
|
108
|
+
@hash = orig.instance_variable_get(:@hash).dup
|
109
|
+
end
|
110
|
+
|
111
|
+
# Clone internal hash.
|
112
|
+
def initialize_clone(orig)
|
113
|
+
super
|
114
|
+
@hash = orig.instance_variable_get(:@hash).clone
|
115
|
+
end
|
116
|
+
|
117
|
+
def freeze # :nodoc:
|
118
|
+
@hash.freeze
|
119
|
+
super
|
120
|
+
end
|
121
|
+
|
122
|
+
def taint # :nodoc:
|
123
|
+
@hash.taint
|
124
|
+
super
|
125
|
+
end
|
126
|
+
|
127
|
+
def untaint # :nodoc:
|
128
|
+
@hash.untaint
|
129
|
+
super
|
130
|
+
end
|
131
|
+
|
132
|
+
# Returns the number of elements.
|
133
|
+
def size
|
134
|
+
@hash.size
|
135
|
+
end
|
136
|
+
alias length size
|
137
|
+
|
138
|
+
# Returns true if the set contains no elements.
|
139
|
+
def empty?
|
140
|
+
@hash.empty?
|
141
|
+
end
|
142
|
+
|
143
|
+
# Removes all elements and returns self.
|
144
|
+
def clear
|
145
|
+
@hash.clear
|
146
|
+
self
|
147
|
+
end
|
148
|
+
|
149
|
+
# Replaces the contents of the set with the contents of the given
|
150
|
+
# enumerable object and returns self.
|
151
|
+
def replace(enum)
|
152
|
+
if enum.instance_of?(self.class)
|
153
|
+
@hash.replace(enum.instance_variable_get(:@hash))
|
154
|
+
self
|
155
|
+
else
|
156
|
+
do_with_enum(enum) # make sure enum is enumerable before calling clear
|
157
|
+
clear
|
158
|
+
merge(enum)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
# Converts the set to an array. The order of elements is uncertain.
|
163
|
+
def to_a
|
164
|
+
@hash.keys
|
165
|
+
end
|
166
|
+
|
167
|
+
# Returns self if no arguments are given. Otherwise, converts the
|
168
|
+
# set to another with klass.new(self, *args, &block).
|
169
|
+
#
|
170
|
+
# In subclasses, returns klass.new(self, *args, &block) unless
|
171
|
+
# overridden.
|
172
|
+
def to_set(klass = Set, *args, &block)
|
173
|
+
return self if instance_of?(Set) && klass == Set && block.nil? && args.empty?
|
174
|
+
klass.new(self, *args, &block)
|
175
|
+
end
|
176
|
+
|
177
|
+
def flatten_merge(set, seen = Set.new) # :nodoc:
|
178
|
+
set.each { |e|
|
179
|
+
if e.is_a?(Set)
|
180
|
+
if seen.include?(e_id = e.object_id)
|
181
|
+
raise ArgumentError, "tried to flatten recursive Set"
|
182
|
+
end
|
183
|
+
|
184
|
+
seen.add(e_id)
|
185
|
+
flatten_merge(e, seen)
|
186
|
+
seen.delete(e_id)
|
187
|
+
else
|
188
|
+
add(e)
|
189
|
+
end
|
190
|
+
}
|
191
|
+
|
192
|
+
self
|
193
|
+
end
|
194
|
+
protected :flatten_merge
|
195
|
+
|
196
|
+
# Returns a new set that is a copy of the set, flattening each
|
197
|
+
# containing set recursively.
|
198
|
+
def flatten
|
199
|
+
self.class.new.flatten_merge(self)
|
200
|
+
end
|
201
|
+
|
202
|
+
# Equivalent to Set#flatten, but replaces the receiver with the
|
203
|
+
# result in place. Returns nil if no modifications were made.
|
204
|
+
def flatten!
|
205
|
+
replace(flatten()) if any? { |e| e.is_a?(Set) }
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns true if the set contains the given object.
|
209
|
+
#
|
210
|
+
# Note that <code>include?</code> and <code>member?</code> do not test member
|
211
|
+
# equality using <code>==</code> as do other Enumerables.
|
212
|
+
#
|
213
|
+
# See also Enumerable#include?
|
214
|
+
def include?(o)
|
215
|
+
@hash[o]
|
216
|
+
end
|
217
|
+
alias member? include?
|
218
|
+
|
219
|
+
# Returns true if the set is a superset of the given set.
|
220
|
+
def superset?(set)
|
221
|
+
case
|
222
|
+
when set.instance_of?(self.class)
|
223
|
+
@hash >= set.instance_variable_get(:@hash)
|
224
|
+
when set.is_a?(Set)
|
225
|
+
size >= set.size && set.all? { |o| include?(o) }
|
226
|
+
else
|
227
|
+
raise ArgumentError, "value must be a set"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
alias >= superset?
|
231
|
+
|
232
|
+
# Returns true if the set is a proper superset of the given set.
|
233
|
+
def proper_superset?(set)
|
234
|
+
case
|
235
|
+
when set.instance_of?(self.class)
|
236
|
+
@hash > set.instance_variable_get(:@hash)
|
237
|
+
when set.is_a?(Set)
|
238
|
+
size > set.size && set.all? { |o| include?(o) }
|
239
|
+
else
|
240
|
+
raise ArgumentError, "value must be a set"
|
241
|
+
end
|
242
|
+
end
|
243
|
+
alias > proper_superset?
|
244
|
+
|
245
|
+
# Returns true if the set is a subset of the given set.
|
246
|
+
def subset?(set)
|
247
|
+
case
|
248
|
+
when set.instance_of?(self.class)
|
249
|
+
@hash <= set.instance_variable_get(:@hash)
|
250
|
+
when set.is_a?(Set)
|
251
|
+
size <= set.size && all? { |o| set.include?(o) }
|
252
|
+
else
|
253
|
+
raise ArgumentError, "value must be a set"
|
254
|
+
end
|
255
|
+
end
|
256
|
+
alias <= subset?
|
257
|
+
|
258
|
+
# Returns true if the set is a proper subset of the given set.
|
259
|
+
def proper_subset?(set)
|
260
|
+
case
|
261
|
+
when set.instance_of?(self.class)
|
262
|
+
@hash < set.instance_variable_get(:@hash)
|
263
|
+
when set.is_a?(Set)
|
264
|
+
size < set.size && all? { |o| set.include?(o) }
|
265
|
+
else
|
266
|
+
raise ArgumentError, "value must be a set"
|
267
|
+
end
|
268
|
+
end
|
269
|
+
alias < proper_subset?
|
270
|
+
|
271
|
+
# Returns true if the set and the given set have at least one
|
272
|
+
# element in common.
|
273
|
+
#
|
274
|
+
# e.g.:
|
275
|
+
#
|
276
|
+
# require 'set'
|
277
|
+
# Set[1, 2, 3].intersect? Set[4, 5] # => false
|
278
|
+
# Set[1, 2, 3].intersect? Set[3, 4] # => true
|
279
|
+
def intersect?(set)
|
280
|
+
set.is_a?(Set) or raise ArgumentError, "value must be a set"
|
281
|
+
if size < set.size
|
282
|
+
any? { |o| set.include?(o) }
|
283
|
+
else
|
284
|
+
set.any? { |o| include?(o) }
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
# Returns true if the set and the given set have no element in
|
289
|
+
# common. This method is the opposite of +intersect?+.
|
290
|
+
#
|
291
|
+
# e.g.:
|
292
|
+
#
|
293
|
+
# require 'set'
|
294
|
+
# Set[1, 2, 3].disjoint? Set[3, 4] # => false
|
295
|
+
# Set[1, 2, 3].disjoint? Set[4, 5] # => true
|
296
|
+
|
297
|
+
def disjoint?(set)
|
298
|
+
!intersect?(set)
|
299
|
+
end
|
300
|
+
|
301
|
+
# Calls the given block once for each element in the set, passing
|
302
|
+
# the element as parameter. Returns an enumerator if no block is
|
303
|
+
# given.
|
304
|
+
def each(&block)
|
305
|
+
block or return enum_for(__method__) { size }
|
306
|
+
@hash.each_key(&block)
|
307
|
+
self
|
308
|
+
end
|
309
|
+
|
310
|
+
# Adds the given object to the set and returns self. Use +merge+ to
|
311
|
+
# add many elements at once.
|
312
|
+
def add(o)
|
313
|
+
@hash[o] = true
|
314
|
+
self
|
315
|
+
end
|
316
|
+
alias << add
|
317
|
+
|
318
|
+
# Adds the given object to the set and returns self. If the
|
319
|
+
# object is already in the set, returns nil.
|
320
|
+
def add?(o)
|
321
|
+
add(o) unless include?(o)
|
322
|
+
end
|
323
|
+
|
324
|
+
# Deletes the given object from the set and returns self. Use +subtract+ to
|
325
|
+
# delete many items at once.
|
326
|
+
def delete(o)
|
327
|
+
@hash.delete(o)
|
328
|
+
self
|
329
|
+
end
|
330
|
+
|
331
|
+
# Deletes the given object from the set and returns self. If the
|
332
|
+
# object is not in the set, returns nil.
|
333
|
+
def delete?(o)
|
334
|
+
delete(o) if include?(o)
|
335
|
+
end
|
336
|
+
|
337
|
+
# Deletes every element of the set for which block evaluates to
|
338
|
+
# true, and returns self.
|
339
|
+
def delete_if
|
340
|
+
block_given? or return enum_for(__method__)
|
341
|
+
# @hash.delete_if should be faster, but using it breaks the order
|
342
|
+
# of enumeration in subclasses.
|
343
|
+
select { |o| yield o }.each { |o| @hash.delete(o) }
|
344
|
+
self
|
345
|
+
end
|
346
|
+
|
347
|
+
# Deletes every element of the set for which block evaluates to
|
348
|
+
# false, and returns self.
|
349
|
+
def keep_if
|
350
|
+
block_given? or return enum_for(__method__)
|
351
|
+
# @hash.keep_if should be faster, but using it breaks the order of
|
352
|
+
# enumeration in subclasses.
|
353
|
+
reject { |o| yield o }.each { |o| @hash.delete(o) }
|
354
|
+
self
|
355
|
+
end
|
356
|
+
|
357
|
+
# Replaces the elements with ones returned by collect().
|
358
|
+
def collect!
|
359
|
+
block_given? or return enum_for(__method__)
|
360
|
+
replace(self.class.new(self) { |o| yield(o) })
|
361
|
+
end
|
362
|
+
alias map! collect!
|
363
|
+
|
364
|
+
# Equivalent to Set#delete_if, but returns nil if no changes were
|
365
|
+
# made.
|
366
|
+
def reject!(&block)
|
367
|
+
block or return enum_for(__method__)
|
368
|
+
n = size
|
369
|
+
delete_if(&block)
|
370
|
+
self if size != n
|
371
|
+
end
|
372
|
+
|
373
|
+
# Equivalent to Set#keep_if, but returns nil if no changes were
|
374
|
+
# made.
|
375
|
+
def select!(&block)
|
376
|
+
block or return enum_for(__method__)
|
377
|
+
n = size
|
378
|
+
keep_if(&block)
|
379
|
+
self if size != n
|
380
|
+
end
|
381
|
+
|
382
|
+
# Merges the elements of the given enumerable object to the set and
|
383
|
+
# returns self.
|
384
|
+
def merge(enum)
|
385
|
+
if enum.instance_of?(self.class)
|
386
|
+
@hash.update(enum.instance_variable_get(:@hash))
|
387
|
+
else
|
388
|
+
do_with_enum(enum) { |o| add(o) }
|
389
|
+
end
|
390
|
+
|
391
|
+
self
|
392
|
+
end
|
393
|
+
|
394
|
+
# Deletes every element that appears in the given enumerable object
|
395
|
+
# and returns self.
|
396
|
+
def subtract(enum)
|
397
|
+
do_with_enum(enum) { |o| delete(o) }
|
398
|
+
self
|
399
|
+
end
|
400
|
+
|
401
|
+
# Returns a new set built by merging the set and the elements of the
|
402
|
+
# given enumerable object.
|
403
|
+
def |(enum)
|
404
|
+
dup.merge(enum)
|
405
|
+
end
|
406
|
+
alias + | ##
|
407
|
+
alias union | ##
|
408
|
+
|
409
|
+
# Returns a new set built by duplicating the set, removing every
|
410
|
+
# element that appears in the given enumerable object.
|
411
|
+
def -(enum)
|
412
|
+
dup.subtract(enum)
|
413
|
+
end
|
414
|
+
alias difference - ##
|
415
|
+
|
416
|
+
# Returns a new set containing elements common to the set and the
|
417
|
+
# given enumerable object.
|
418
|
+
def &(enum)
|
419
|
+
n = self.class.new
|
420
|
+
do_with_enum(enum) { |o| n.add(o) if include?(o) }
|
421
|
+
n
|
422
|
+
end
|
423
|
+
alias intersection & ##
|
424
|
+
|
425
|
+
# Returns a new set containing elements exclusive between the set
|
426
|
+
# and the given enumerable object. (set ^ enum) is equivalent to
|
427
|
+
# ((set | enum) - (set & enum)).
|
428
|
+
def ^(enum)
|
429
|
+
n = Set.new(enum)
|
430
|
+
each { |o| n.add(o) unless n.delete?(o) }
|
431
|
+
n
|
432
|
+
end
|
433
|
+
|
434
|
+
# Returns true if two sets are equal. The equality of each couple
|
435
|
+
# of elements is defined according to Object#eql?.
|
436
|
+
def ==(other)
|
437
|
+
if self.equal?(other)
|
438
|
+
true
|
439
|
+
elsif other.instance_of?(self.class)
|
440
|
+
@hash == other.instance_variable_get(:@hash)
|
441
|
+
elsif other.is_a?(Set) && self.size == other.size
|
442
|
+
other.all? { |o| @hash.include?(o) }
|
443
|
+
else
|
444
|
+
false
|
445
|
+
end
|
446
|
+
end
|
447
|
+
|
448
|
+
def hash # :nodoc:
|
449
|
+
@hash.hash
|
450
|
+
end
|
451
|
+
|
452
|
+
def eql?(o) # :nodoc:
|
453
|
+
return false unless o.is_a?(Set)
|
454
|
+
@hash.eql?(o.instance_variable_get(:@hash))
|
455
|
+
end
|
456
|
+
|
457
|
+
# Classifies the set by the return value of the given block and
|
458
|
+
# returns a hash of {value => set of elements} pairs. The block is
|
459
|
+
# called once for each element of the set, passing the element as
|
460
|
+
# parameter.
|
461
|
+
#
|
462
|
+
# e.g.:
|
463
|
+
#
|
464
|
+
# require 'set'
|
465
|
+
# files = Set.new(Dir.glob("*.rb"))
|
466
|
+
# hash = files.classify { |f| File.mtime(f).year }
|
467
|
+
# p hash # => {2000=>#<Set: {"a.rb", "b.rb"}>,
|
468
|
+
# # 2001=>#<Set: {"c.rb", "d.rb", "e.rb"}>,
|
469
|
+
# # 2002=>#<Set: {"f.rb"}>}
|
470
|
+
def classify # :yields: o
|
471
|
+
block_given? or return enum_for(__method__)
|
472
|
+
|
473
|
+
h = {}
|
474
|
+
|
475
|
+
each { |i|
|
476
|
+
(h[yield(i)] ||= self.class.new).add(i)
|
477
|
+
}
|
478
|
+
|
479
|
+
h
|
480
|
+
end
|
481
|
+
|
482
|
+
# Divides the set into a set of subsets according to the commonality
|
483
|
+
# defined by the given block.
|
484
|
+
#
|
485
|
+
# If the arity of the block is 2, elements o1 and o2 are in common
|
486
|
+
# if block.call(o1, o2) is true. Otherwise, elements o1 and o2 are
|
487
|
+
# in common if block.call(o1) == block.call(o2).
|
488
|
+
#
|
489
|
+
# e.g.:
|
490
|
+
#
|
491
|
+
# require 'set'
|
492
|
+
# numbers = Set[1, 3, 4, 6, 9, 10, 11]
|
493
|
+
# set = numbers.divide { |i,j| (i - j).abs == 1 }
|
494
|
+
# p set # => #<Set: {#<Set: {1}>,
|
495
|
+
# # #<Set: {11, 9, 10}>,
|
496
|
+
# # #<Set: {3, 4}>,
|
497
|
+
# # #<Set: {6}>}>
|
498
|
+
def divide(&func)
|
499
|
+
func or return enum_for(__method__)
|
500
|
+
|
501
|
+
if func.arity == 2
|
502
|
+
require 'tsort'
|
503
|
+
|
504
|
+
class << dig = {} # :nodoc:
|
505
|
+
include TSort
|
506
|
+
|
507
|
+
alias tsort_each_node each_key
|
508
|
+
def tsort_each_child(node, &block)
|
509
|
+
fetch(node).each(&block)
|
510
|
+
end
|
511
|
+
end
|
512
|
+
|
513
|
+
each { |u|
|
514
|
+
dig[u] = a = []
|
515
|
+
each{ |v| func.call(u, v) and a << v }
|
516
|
+
}
|
517
|
+
|
518
|
+
set = Set.new()
|
519
|
+
dig.each_strongly_connected_component { |css|
|
520
|
+
set.add(self.class.new(css))
|
521
|
+
}
|
522
|
+
set
|
523
|
+
else
|
524
|
+
Set.new(classify(&func).values)
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
528
|
+
InspectKey = :__inspect_key__ # :nodoc:
|
529
|
+
|
530
|
+
# Returns a string containing a human-readable representation of the
|
531
|
+
# set. ("#<Set: {element1, element2, ...}>")
|
532
|
+
def inspect
|
533
|
+
ids = (Thread.current[InspectKey] ||= [])
|
534
|
+
|
535
|
+
if ids.include?(object_id)
|
536
|
+
return sprintf('#<%s: {...}>', self.class.name)
|
537
|
+
end
|
538
|
+
|
539
|
+
ids << object_id
|
540
|
+
begin
|
541
|
+
return sprintf('#<%s: {%s}>', self.class, to_a.inspect[1..-2])
|
542
|
+
ensure
|
543
|
+
ids.pop
|
544
|
+
end
|
545
|
+
end
|
546
|
+
|
547
|
+
def pretty_print(pp) # :nodoc:
|
548
|
+
pp.text sprintf('#<%s: {', self.class.name)
|
549
|
+
pp.nest(1) {
|
550
|
+
pp.seplist(self) { |o|
|
551
|
+
pp.pp o
|
552
|
+
}
|
553
|
+
}
|
554
|
+
pp.text "}>"
|
555
|
+
end
|
556
|
+
|
557
|
+
def pretty_print_cycle(pp) # :nodoc:
|
558
|
+
pp.text sprintf('#<%s: {%s}>', self.class.name, empty? ? '' : '...')
|
559
|
+
end
|
560
|
+
end
|
561
|
+
|
562
|
+
#
|
563
|
+
# SortedSet implements a Set that guarantees that its elements are
|
564
|
+
# yielded in sorted order (according to the return values of their
|
565
|
+
# #<=> methods) when iterating over them.
|
566
|
+
#
|
567
|
+
# All elements that are added to a SortedSet must respond to the <=>
|
568
|
+
# method for comparison.
|
569
|
+
#
|
570
|
+
# Also, all elements must be <em>mutually comparable</em>: <tt>el1 <=>
|
571
|
+
# el2</tt> must not return <tt>nil</tt> for any elements <tt>el1</tt>
|
572
|
+
# and <tt>el2</tt>, else an ArgumentError will be raised when
|
573
|
+
# iterating over the SortedSet.
|
574
|
+
#
|
575
|
+
# == Example
|
576
|
+
#
|
577
|
+
# require "set"
|
578
|
+
#
|
579
|
+
# set = SortedSet.new([2, 1, 5, 6, 4, 5, 3, 3, 3])
|
580
|
+
# ary = []
|
581
|
+
#
|
582
|
+
# set.each do |obj|
|
583
|
+
# ary << obj
|
584
|
+
# end
|
585
|
+
#
|
586
|
+
# p ary # => [1, 2, 3, 4, 5, 6]
|
587
|
+
#
|
588
|
+
# set2 = SortedSet.new([1, 2, "3"])
|
589
|
+
# set2.each { |obj| } # => raises ArgumentError: comparison of Fixnum with String failed
|
590
|
+
#
|
591
|
+
class SortedSet < Set
|
592
|
+
@@setup = false
|
593
|
+
|
594
|
+
class << self
|
595
|
+
def [](*ary) # :nodoc:
|
596
|
+
new(ary)
|
597
|
+
end
|
598
|
+
|
599
|
+
def setup # :nodoc:
|
600
|
+
@@setup and return
|
601
|
+
|
602
|
+
module_eval {
|
603
|
+
# a hack to shut up warning
|
604
|
+
alias old_init initialize
|
605
|
+
}
|
606
|
+
begin
|
607
|
+
require 'rbtree'
|
608
|
+
|
609
|
+
module_eval <<-END, __FILE__, __LINE__+1
|
610
|
+
def initialize(*args)
|
611
|
+
@hash = RBTree.new
|
612
|
+
super
|
613
|
+
end
|
614
|
+
|
615
|
+
def add(o)
|
616
|
+
o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
|
617
|
+
super
|
618
|
+
end
|
619
|
+
alias << add
|
620
|
+
END
|
621
|
+
rescue LoadError
|
622
|
+
module_eval <<-END, __FILE__, __LINE__+1
|
623
|
+
def initialize(*args)
|
624
|
+
@keys = nil
|
625
|
+
super
|
626
|
+
end
|
627
|
+
|
628
|
+
def clear
|
629
|
+
@keys = nil
|
630
|
+
super
|
631
|
+
end
|
632
|
+
|
633
|
+
def replace(enum)
|
634
|
+
@keys = nil
|
635
|
+
super
|
636
|
+
end
|
637
|
+
|
638
|
+
def add(o)
|
639
|
+
o.respond_to?(:<=>) or raise ArgumentError, "value must respond to <=>"
|
640
|
+
@keys = nil
|
641
|
+
super
|
642
|
+
end
|
643
|
+
alias << add
|
644
|
+
|
645
|
+
def delete(o)
|
646
|
+
@keys = nil
|
647
|
+
@hash.delete(o)
|
648
|
+
self
|
649
|
+
end
|
650
|
+
|
651
|
+
def delete_if
|
652
|
+
block_given? or return enum_for(__method__)
|
653
|
+
n = @hash.size
|
654
|
+
super
|
655
|
+
@keys = nil if @hash.size != n
|
656
|
+
self
|
657
|
+
end
|
658
|
+
|
659
|
+
def keep_if
|
660
|
+
block_given? or return enum_for(__method__)
|
661
|
+
n = @hash.size
|
662
|
+
super
|
663
|
+
@keys = nil if @hash.size != n
|
664
|
+
self
|
665
|
+
end
|
666
|
+
|
667
|
+
def merge(enum)
|
668
|
+
@keys = nil
|
669
|
+
super
|
670
|
+
end
|
671
|
+
|
672
|
+
def each(&block)
|
673
|
+
block or return enum_for(__method__) { size }
|
674
|
+
to_a.each(&block)
|
675
|
+
self
|
676
|
+
end
|
677
|
+
|
678
|
+
def to_a
|
679
|
+
(@keys = @hash.keys).sort! unless @keys
|
680
|
+
@keys
|
681
|
+
end
|
682
|
+
END
|
683
|
+
end
|
684
|
+
module_eval {
|
685
|
+
# a hack to shut up warning
|
686
|
+
remove_method :old_init
|
687
|
+
}
|
688
|
+
|
689
|
+
@@setup = true
|
690
|
+
end
|
691
|
+
end
|
692
|
+
|
693
|
+
def initialize(*args, &block) # :nodoc:
|
694
|
+
SortedSet.setup
|
695
|
+
initialize(*args, &block)
|
696
|
+
end
|
697
|
+
end
|
698
|
+
|
699
|
+
module Enumerable
|
700
|
+
# Makes a set from the enumerable object with given arguments.
|
701
|
+
# Needs to +require "set"+ to use this method.
|
702
|
+
def to_set(klass = Set, *args, &block)
|
703
|
+
klass.new(self, *args, &block)
|
704
|
+
end
|
705
|
+
end
|
706
|
+
|
707
|
+
# =begin
|
708
|
+
# == RestricedSet class
|
709
|
+
# RestricedSet implements a set with restrictions defined by a given
|
710
|
+
# block.
|
711
|
+
#
|
712
|
+
# === Super class
|
713
|
+
# Set
|
714
|
+
#
|
715
|
+
# === Class Methods
|
716
|
+
# --- RestricedSet::new(enum = nil) { |o| ... }
|
717
|
+
# --- RestricedSet::new(enum = nil) { |rset, o| ... }
|
718
|
+
# Creates a new restricted set containing the elements of the given
|
719
|
+
# enumerable object. Restrictions are defined by the given block.
|
720
|
+
#
|
721
|
+
# If the block's arity is 2, it is called with the RestrictedSet
|
722
|
+
# itself and an object to see if the object is allowed to be put in
|
723
|
+
# the set.
|
724
|
+
#
|
725
|
+
# Otherwise, the block is called with an object to see if the object
|
726
|
+
# is allowed to be put in the set.
|
727
|
+
#
|
728
|
+
# === Instance Methods
|
729
|
+
# --- restriction_proc
|
730
|
+
# Returns the restriction procedure of the set.
|
731
|
+
#
|
732
|
+
# =end
|
733
|
+
#
|
734
|
+
# class RestricedSet < Set
|
735
|
+
# def initialize(*args, &block)
|
736
|
+
# @proc = block or raise ArgumentError, "missing a block"
|
737
|
+
#
|
738
|
+
# if @proc.arity == 2
|
739
|
+
# instance_eval %{
|
740
|
+
# def add(o)
|
741
|
+
# @hash[o] = true if @proc.call(self, o)
|
742
|
+
# self
|
743
|
+
# end
|
744
|
+
# alias << add
|
745
|
+
#
|
746
|
+
# def add?(o)
|
747
|
+
# if include?(o) || !@proc.call(self, o)
|
748
|
+
# nil
|
749
|
+
# else
|
750
|
+
# @hash[o] = true
|
751
|
+
# self
|
752
|
+
# end
|
753
|
+
# end
|
754
|
+
#
|
755
|
+
# def replace(enum)
|
756
|
+
# enum.respond_to?(:each) or raise ArgumentError, "value must be enumerable"
|
757
|
+
# clear
|
758
|
+
# enum.each_entry { |o| add(o) }
|
759
|
+
#
|
760
|
+
# self
|
761
|
+
# end
|
762
|
+
#
|
763
|
+
# def merge(enum)
|
764
|
+
# enum.respond_to?(:each) or raise ArgumentError, "value must be enumerable"
|
765
|
+
# enum.each_entry { |o| add(o) }
|
766
|
+
#
|
767
|
+
# self
|
768
|
+
# end
|
769
|
+
# }
|
770
|
+
# else
|
771
|
+
# instance_eval %{
|
772
|
+
# def add(o)
|
773
|
+
# if @proc.call(o)
|
774
|
+
# @hash[o] = true
|
775
|
+
# end
|
776
|
+
# self
|
777
|
+
# end
|
778
|
+
# alias << add
|
779
|
+
#
|
780
|
+
# def add?(o)
|
781
|
+
# if include?(o) || !@proc.call(o)
|
782
|
+
# nil
|
783
|
+
# else
|
784
|
+
# @hash[o] = true
|
785
|
+
# self
|
786
|
+
# end
|
787
|
+
# end
|
788
|
+
# }
|
789
|
+
# end
|
790
|
+
#
|
791
|
+
# super(*args)
|
792
|
+
# end
|
793
|
+
#
|
794
|
+
# def restriction_proc
|
795
|
+
# @proc
|
796
|
+
# end
|
797
|
+
# end
|
798
|
+
|
799
|
+
# Tests have been moved to test/test_set.rb.
|