rhodes 3.0.2 → 3.1.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +13 -2
- data/Rakefile +200 -18
- data/bin/get-rhodes-info +1 -1
- data/doc/build.txt +174 -98
- data/doc/configuration.txt +13 -2
- data/doc/device-caps.txt +184 -24
- data/doc/extensions.txt +19 -1
- data/doc/generator.txt +18 -18
- data/doc/install.txt +15 -4
- data/doc/introduction.txt +19 -20
- data/doc/nfc.txt +1617 -513
- data/doc/release.txt +85 -41
- data/doc/rhom.txt +11 -1
- data/doc/simulator.txt +15 -5
- data/doc/synchronization.txt +21 -7
- data/doc/ui.txt +4 -0
- data/installer/rhostudio.nsi +464 -0
- data/lib/build/compileERB/bb.rb +26 -0
- data/lib/build/compileERB/default.rb +26 -0
- data/lib/build/compileRB/compileRB.rb +26 -0
- data/lib/build/jake.rb +27 -2
- data/lib/build/rhodes-build.rb +26 -0
- data/lib/extensions/barcode/ext.yml +3 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/AndroidManifest.xml +27 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +13 -13
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable-hdpi/cancel_icon.png +0 -0
- data/{platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_on.png → lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable-hdpi/ok_icon.png} +0 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable-hdpi/retake_icon.png +0 -0
- data/{platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_on.png → lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable/cancel_icon.png} +0 -0
- data/{platform/wp7/WPApplication/rho/apps/public/images/android/disclosure.png → lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable/ok_icon.png} +0 -0
- data/{platform/wp7/WPApplication/rho/apps/public/images/android/btn_radio_off.png → lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/drawable/retake_icon.png} +0 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/layout/capture.xml +122 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/raw/beep.ogg +0 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/values/attrs.xml +20 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/values/colors.xml +42 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/additional_files/res/values/ids.xml +31 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/ext_build.files +15 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/jni/src/barcode.cpp +16 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/CaptureActivity.java +778 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/CaptureActivityHandler.java +136 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/DecodeHandler.java +99 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/DecodeThread.java +121 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/FinishListener.java +48 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/InactivityTimer.java +71 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/LocaleManager.java +97 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/PlanarYUVLuminanceSource.java +133 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/ViewfinderResultPointCallback.java +34 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/ViewfinderView.java +157 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/camera/AutoFocusCallback.java +51 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +280 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/camera/CameraManager.java +318 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/camera/FlashlightManager.java +148 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/google/zxing/client/android/camera/PreviewCallback.java +59 -0
- data/lib/extensions/barcode/ext/barcode/platform/android/src/com/rhomobile/barcode/Barcode.java +44 -1
- data/lib/extensions/barcode/ext/barcode/platform/bb/Rakefile +1 -1
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/barcode.m +4 -0
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode.i +5 -0
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +138 -389
- data/lib/extensions/barcode/ext/barcode/shared/src/zbar.c +5 -0
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/README.TXT +5 -0
- data/lib/extensions/debugger/CHANGELOG +10 -0
- data/lib/extensions/debugger/LICENSE +21 -0
- data/lib/extensions/debugger/README.md +8 -0
- data/lib/extensions/debugger/debugger.rb +57 -9
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.h +24 -7
- data/lib/extensions/esri/ext/esri/platform/iphone/Classes/MapViewControllerESRI.m +18 -17
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/Nfc.java +9 -4
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcActivity.java +1 -1
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessage.java +0 -1
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcMessagePack.java +0 -1
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcRecord.java +1 -1
- data/lib/extensions/nfc/ext/nfc/platform/android/src/com/rhomobile/nfc/NfcTechActivity.java +0 -1
- data/lib/extensions/nfc/nfc.rb +9 -3
- data/lib/extensions/rholang/rholang/lang_cs.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_da.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_de.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_es.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_es_ar.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_ko.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_nl.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_no.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_pt_br.rb +4 -4
- data/lib/extensions/rholang/rholang/lang_se.rb +3 -3
- data/lib/extensions/rholang/rholang/lang_sr.rb +3 -3
- data/lib/framework/builtinME.rb +31 -2
- data/lib/framework/dateME.rb +26 -0
- data/lib/framework/res/back_btn.sym.png +0 -0
- data/lib/framework/res/blue_pushpin_small.sym.png +0 -0
- data/lib/framework/res/callout.sym.png +0 -0
- data/lib/framework/res/callout_link.sym.png +0 -0
- data/lib/framework/res/esri.sym.png +0 -0
- data/lib/framework/res/forward_btn.sym.png +0 -0
- data/lib/framework/res/home_btn.sym.png +0 -0
- data/{platform/wp7/WPApplication/rho/apps/public/images/android/btn_check_off.png → lib/framework/res/options_btn.sym.png} +0 -0
- data/lib/framework/res/refresh_btn.sym.png +0 -0
- data/lib/framework/rho/mapview.rb +26 -0
- data/lib/framework/rho/render.rb +34 -2
- data/lib/framework/rho/rho.rb +28 -2
- data/lib/framework/rho/rhoapplication.rb +26 -0
- data/lib/framework/rho/rhobluetooth.rb +70 -0
- data/lib/framework/rho/rhocontact.rb +26 -0
- data/lib/framework/rho/rhocontroller.rb +26 -0
- data/lib/framework/rho/rhoerror.rb +26 -0
- data/lib/framework/rho/rhoevent.rb +26 -0
- data/lib/framework/rho/rhoevent_bb.rb +26 -0
- data/lib/framework/rho/rhoevent_c.rb +26 -0
- data/lib/framework/rho/rhofsconnector.rb +25 -0
- data/lib/framework/rho/rhomsg.rb +26 -0
- data/lib/framework/rho/rhonativeviewmanager.rb +25 -0
- data/lib/framework/rho/rhosupport.rb +32 -1
- data/lib/framework/rho/rhotabbar.rb +27 -1
- data/lib/framework/rho/rhotoolbar.rb +26 -1
- data/lib/framework/rho/rhoutils.rb +26 -0
- data/lib/framework/rho/rhoviewhelpers.rb +26 -0
- data/lib/framework/rhoappmanifest.rb +26 -0
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +77 -0
- data/lib/framework/rhom/rhom.rb +30 -19
- data/lib/framework/rhom/rhom_db_adapter.rb +26 -19
- data/lib/framework/rhom/rhom_model.rb +25 -0
- data/lib/framework/rhom/rhom_object.rb +26 -19
- data/lib/framework/rhom/rhom_object_factory.rb +73 -55
- data/lib/framework/rhom/rhom_source.rb +26 -0
- data/lib/framework/rhosystem.rb +47 -16
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml +5 -4
- data/platform/android/Rhodes/default.properties +1 -1
- data/platform/android/Rhodes/jni/Android.mk +365 -0
- data/platform/android/Rhodes/jni/Application.mk +3 -0
- data/platform/android/Rhodes/jni/genconfig.h +17 -0
- data/platform/android/Rhodes/jni/include/rhodes.h +26 -0
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhoRuby.h +71 -0
- data/platform/android/Rhodes/jni/include/rhodes/JNIRhodes.h +47 -33
- data/platform/android/Rhodes/jni/include/rhodes/RhoClassFactory.h +46 -1
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhoLogConf.h +11 -11
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_RhodesService.h +1 -9
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_camera_Camera.h +2 -2
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_file_RhoFileApi.h +8 -0
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_mainview_SplashScreen.h +39 -0
- data/platform/android/Rhodes/jni/include/rhodes/rhocryptimpl.h +26 -0
- data/platform/android/Rhodes/jni/include/rhodes/sslimpl.h +26 -0
- data/platform/android/Rhodes/jni/rhocaps.inc +12 -0
- data/platform/android/Rhodes/jni/src/JNIRhoRuby.cpp +204 -0
- data/platform/android/Rhodes/jni/src/RhoClassFactory.cpp +32 -5
- data/platform/android/Rhodes/jni/src/alert.cpp +29 -5
- data/platform/android/Rhodes/jni/src/bluetooth.cpp +68 -3
- data/platform/android/Rhodes/jni/src/callbacks.cpp +40 -15
- data/platform/android/Rhodes/jni/src/camera.cpp +84 -7
- data/platform/android/Rhodes/jni/src/datetimepicker.cpp +26 -0
- data/platform/android/Rhodes/jni/src/event.cpp +27 -0
- data/platform/android/Rhodes/jni/src/fileapi.cpp +66 -2
- data/platform/android/Rhodes/jni/src/geolocation.cpp +26 -0
- data/platform/android/Rhodes/jni/src/logconf.cpp +44 -29
- data/platform/android/Rhodes/jni/src/logger.cpp +26 -0
- data/platform/android/Rhodes/jni/src/mapview.cpp +30 -0
- data/platform/android/Rhodes/jni/src/menu.cpp +26 -0
- data/platform/android/Rhodes/jni/src/nativebar.cpp +27 -8
- data/platform/android/Rhodes/jni/src/nativeview.cpp +26 -0
- data/platform/android/Rhodes/jni/src/navbar.cpp +27 -0
- data/platform/android/Rhodes/jni/src/phonebook.cpp +27 -0
- data/platform/android/Rhodes/jni/src/rhoconf.cpp +26 -0
- data/platform/android/Rhodes/jni/src/rhocryptimpl.cpp +26 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +40 -593
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +326 -0
- data/platform/android/Rhodes/jni/src/rhodessystem.cpp +186 -0
- data/platform/android/Rhodes/jni/src/ringtones.cpp +27 -0
- data/platform/android/Rhodes/jni/src/signature.cpp +26 -0
- data/platform/android/Rhodes/jni/src/socketimpl.cpp +26 -0
- data/platform/android/Rhodes/jni/src/splashscreen.cpp +30 -4
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +27 -0
- data/platform/android/Rhodes/jni/src/webview.cpp +27 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/BaseActivity.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/HttpLog.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/LocalFileProvider.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Logger.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeLibraries.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NavBar.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Push.java +27 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushReceiver.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/PushService.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoConf.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoCryptImpl.java +29 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoLogConf.java +36 -30
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +81 -73
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityListener.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivityStartupListeners.java +1 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesAppOptions.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesApplication.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +83 -38
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RingtoneManager.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/PopupActivity.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/StatusNotification.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothDeviceListActivity.java +35 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +52 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +182 -56
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +41 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothSession.java +60 -23
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/UUIDHelper.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +162 -27
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +152 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraOldService.java +49 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +140 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraService.java +49 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSettings.java +147 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/FileList.java +27 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +124 -53
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCaptureCallback.java +39 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePicker.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/datetime/DateTimePickerScreen.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/file/RhoFileApi.java +75 -9
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +28 -22
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/{SplashScreen.java → mainview/SplashScreen.java} +73 -22
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +27 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/Annotation.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/ExtrasHolder.java +51 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +41 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapTouch.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MapView.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/MultiTouchHandler.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/OneTouchHandler.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/TouchHandler.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactField.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/ImageCapture.java +26 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/Signature.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/signature/SignatureView.java +25 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/RhoSockAddr.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/RhoSocket.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/RhoSocketImpl.java +28 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +85 -30
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/AboutDialog.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogOptionsDialog.java +32 -30
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/ui/LogViewDialog.java +29 -28
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/ExternalHttpHandler.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/LocalFileHandler.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/SmsUriHandler.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +25 -20
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/ContextFactory.java +38 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PerformOnUiThread.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/util/PhoneId.java +137 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/{Utils.java → util/Utils.java} +27 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientNew.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettings.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsNew.java +27 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +26 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebViewClient.java +107 -0
- data/platform/android/build/RhodesSRC_build.files +11 -4
- data/platform/android/build/android.rake +79 -116
- data/platform/android/build/android_tools.rb +117 -0
- data/platform/android/build/androidcommon.rb +30 -4
- data/platform/android/build/libjson_build.files +1 -1
- data/platform/android/build/librhodes_build.files +3 -0
- data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +26 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +26 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +26 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +26 -0
- data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +26 -0
- data/platform/bb/Hsqldb/src/j2me/math/BigDecimal.java +26 -0
- data/platform/bb/Hsqldb/src/j2me/math/BigInteger.java +26 -0
- data/platform/bb/Hsqldb/src/j2me/sql/Date.java +26 -0
- data/platform/bb/Hsqldb/src/j2me/sql/Time.java +26 -0
- data/platform/bb/Hsqldb/src/j2me/sql/Timestamp.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/DateTimeTokenizer.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/FilePath.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/IRhoLogSink.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/IRhoRubyHelper.java +27 -0
- data/platform/bb/RubyVM/src/com/rho/Mutex.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/Properties.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoAppAdapter.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoClassFactory.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoCrypto.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoEmptyLogger.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoEmptyProfiler.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoLogConf.java +52 -1
- data/platform/bb/RubyVM/src/com/rho/RhoLogFileSink.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoLogOutputSink.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoLogger.java +111 -2
- data/platform/bb/RubyVM/src/com/rho/RhoParamArray.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoParams.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoProfiler.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoRuby.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoThread.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhoTimer.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/RhodesApp.java +32 -3
- data/platform/bb/RubyVM/src/com/rho/SplashScreen.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/Sprintf.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/StringScanner.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/TestProfiler.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/TestRhoLog.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/ThreadQueue.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/TimeInterval.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/Tokenizer.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +32 -0
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/db/DBException.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/db/IDBCallback.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/db/IDBResult.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/db/IDBStorage.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/FileAccessBB.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/IFile.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/IFileAccess.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/IRAFile.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/RandomAccessFile.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/file/SimpleFile.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/net/AsyncHttp.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/net/IHttpConnection.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/net/NetRequest.java +295 -230
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +29 -16
- data/platform/bb/RubyVM/src/com/rho/rjson/RJSONTokener.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ISyncProtocol.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/ISyncStatusListener.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/JSONArrayIterator.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/JSONEntry.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/JSONStructIterator.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +26 -19
- data/platform/bb/RubyVM/src/com/rho/sync/SyncNotify.java +26 -0
- data/platform/bb/RubyVM/src/com/rho/sync/SyncProtocol_3.java +31 -5
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +49 -37
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +40 -18
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyDir.java +2 -1
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyIOFileExecutor.java +7 -2
- data/platform/bb/RubyVM/src/com/xruby/runtime/builtin/RubyTime.java +43 -13
- data/platform/bb/RubyVM/src/j2me/lang/ArrayMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/AssertMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/CalendarMe.java +28 -1
- data/platform/bb/RubyVM/src/j2me/lang/CharacterDataLatin1.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/CharacterMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/Convert.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/MathEx.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/PrintStreamMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/StringBufferMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/StringMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/SystemMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/lang/TimeZoneMe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/math/HugeDigit.java +26 -0
- data/platform/bb/RubyVM/src/j2me/math/HugeInt.java +26 -0
- data/platform/bb/RubyVM/src/j2me/math/HugeIntHelper.java +26 -0
- data/platform/bb/RubyVM/src/j2me/math/Number.java +26 -0
- data/platform/bb/RubyVM/src/j2me/nio/channels/FileChannel.java +26 -0
- data/platform/bb/RubyVM/src/j2me/nio/channels/Pipe.java +26 -0
- data/platform/bb/RubyVM/src/j2me/util/WeakHashMap.java +26 -0
- data/platform/bb/RubyVM/src/j2me/util/concurrent/ConcurrentHashMap.java +26 -0
- data/platform/bb/RubyVM/src/j2me/util/concurrent/locks/ReentrantLock.java +26 -0
- data/platform/bb/build/bb.rake +45 -6
- data/platform/bb/rhodes/platform/4.2.0/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/platform/4.2.1/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/platform/4.2.2/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/platform/4.2/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +26 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +26 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhodesApplicationPlatform.java +26 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteCopyResult.java +26 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteResult.java +26 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/db/SqliteStorage.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhoMainScreen.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/RhodesApplicationPlatform.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteCopyResult.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteResult.java +26 -0
- data/platform/bb/rhodes/platform/common/com/rho/db/SqliteStorage.java +26 -0
- data/platform/bb/rhodes/src/com/rho/BBVersionSpecific.java +26 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +26 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +26 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +26 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +26 -0
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +45 -1
- data/platform/bb/rhodes/src/com/rho/RhodesApplicationPlatform.java +26 -0
- data/platform/bb/rhodes/src/com/rho/Version.java +26 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteCopyResult.java +26 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteResult.java +26 -0
- data/platform/bb/rhodes/src/com/rho/db/SqliteStorage.java +26 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75File.java +26 -0
- data/platform/bb/rhodes/src/com/rho/file/Jsr75RAFileImpl.java +28 -2
- data/platform/bb/rhodes/src/com/rho/file/PersistRAFileImpl.java +29 -2
- data/platform/bb/rhodes/src/com/rho/net/BaseSocket.java +26 -0
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +26 -0
- data/platform/bb/rhodes/src/com/rho/net/SSLSocket.java +26 -0
- data/platform/bb/rhodes/src/com/rho/net/TCPSocket.java +26 -0
- data/platform/bb/rhodes/src/com/rho/net/bb/BBHttpConnection.java +26 -0
- data/platform/bb/rhodes/src/com/rho/net/bb/NativeBBHttpConnection.java +26 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +26 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +26 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoCalendar.java +26 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/RhoPhonebook.java +26 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +27 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +59 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/XMLParser.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/LogOptionsScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/LogScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/NativeBar.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +27 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/RingtoneManager.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothManager.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothPort.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/bluetooth/BluetoothScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/camera/Camera.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/camera/CameraFilesListener.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimePicker.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/datetime/DateTimeScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapField.java +736 -695
- data/platform/bb/rhodes/src/rhomobile/mapview/ESRIMapProvider.java +40 -14
- data/platform/bb/rhodes/src/rhomobile/mapview/GeoCoding.java +39 -13
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleGeoCoding.java +216 -174
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +87 -45
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapProvider.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapProvider.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapTools.java +105 -79
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewParent.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +26 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/RhoMapField.java +26 -0
- data/platform/iphone/Classes/AppManager/AppLoader.h +25 -7
- data/platform/iphone/Classes/AppManager/AppLoader.m +26 -7
- data/platform/iphone/Classes/AppManager/AppManager.h +25 -7
- data/platform/iphone/Classes/AppManager/AppManager.m +26 -8
- data/platform/iphone/Classes/AppManager/AppManagerI.h +25 -8
- data/platform/iphone/Classes/Bluetooth/Bluetooth.h +39 -10
- data/platform/iphone/Classes/Bluetooth/Bluetooth.m +158 -28
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +72 -9
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +432 -15
- data/platform/iphone/Classes/DateTime.h +25 -7
- data/platform/iphone/Classes/DateTime.m +25 -7
- data/platform/iphone/Classes/DateTimePicker.m +25 -7
- data/platform/iphone/Classes/DateTimePickerDelegate.h +25 -7
- data/platform/iphone/Classes/DateTimePickerDelegate.m +25 -7
- data/platform/iphone/Classes/Dispatcher/Dispatcher.c +26 -8
- data/platform/iphone/Classes/Dispatcher/Dispatcher.h +25 -8
- data/platform/iphone/Classes/Event/Event.h +25 -7
- data/platform/iphone/Classes/GeoLocation/LocationController.h +25 -7
- data/platform/iphone/Classes/LogOptionsController.h +25 -7
- data/platform/iphone/Classes/LogOptionsController.m +25 -7
- data/platform/iphone/Classes/LogViewController.h +25 -7
- data/platform/iphone/Classes/LogViewController.m +27 -9
- data/platform/iphone/Classes/MapView/GoogleGeocoder.h +26 -0
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +26 -0
- data/platform/iphone/Classes/MapView/MapAnnotation.h +26 -6
- data/platform/iphone/Classes/MapView/MapAnnotation.m +25 -6
- data/platform/iphone/Classes/MapView/MapViewController.h +27 -8
- data/platform/iphone/Classes/MapView/MapViewController.m +26 -6
- data/platform/iphone/Classes/MapView/MapViewManager.h +26 -4
- data/platform/iphone/Classes/MapView/MapViewManager.m +25 -5
- data/platform/iphone/Classes/NativeBar.h +25 -7
- data/platform/iphone/Classes/NativeBar.m +54 -39
- data/platform/iphone/Classes/NativeView/NVDelegate.h +25 -7
- data/platform/iphone/Classes/NativeView/NVDelegate.m +25 -7
- data/platform/iphone/Classes/NativeView/NVViewController.h +25 -7
- data/platform/iphone/Classes/NativeView/NVViewController.m +25 -7
- data/platform/iphone/Classes/NativeView/RhoNativeViewManager.mm +27 -10
- data/platform/iphone/Classes/NativeView/RhoNativeViewManagerOC.h +25 -7
- data/platform/iphone/Classes/NavBar.h +25 -7
- data/platform/iphone/Classes/NavBar.m +25 -7
- data/platform/iphone/Classes/Phonebook/phonebook.h +26 -8
- data/platform/iphone/Classes/Phonebook/phonebook.m +25 -8
- data/platform/iphone/Classes/RhoAlert.h +25 -7
- data/platform/iphone/Classes/RhoAlert.m +27 -9
- data/platform/iphone/Classes/RhoDelegate.h +25 -7
- data/platform/iphone/Classes/RhoDelegate.m +25 -7
- data/platform/iphone/Classes/RhoMainView.h +26 -8
- data/platform/iphone/Classes/RhoViewController.h +25 -7
- data/platform/iphone/Classes/RhoViewController.m +25 -7
- data/platform/iphone/Classes/Rhodes.h +25 -8
- data/platform/iphone/Classes/Rhodes.m +50 -6
- data/platform/iphone/Classes/RingtoneManager.h +25 -7
- data/platform/iphone/Classes/RingtoneManager.m +25 -7
- data/platform/iphone/Classes/Signature/SignatureDelegate.h +25 -7
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +25 -7
- data/platform/iphone/Classes/Signature/SignatureView.h +25 -7
- data/platform/iphone/Classes/Signature/SignatureView.m +25 -15
- data/platform/iphone/Classes/Signature/SignatureViewController.h +25 -7
- data/platform/iphone/Classes/Signature/SignatureViewController.m +25 -7
- data/platform/iphone/Classes/SimpleMainView.h +25 -7
- data/platform/iphone/Classes/SimpleMainView.m +31 -7
- data/platform/iphone/Classes/SplashViewController.h +25 -7
- data/platform/iphone/Classes/SplashViewController.m +25 -7
- data/platform/iphone/Classes/SplitView/LeftViewController.h +25 -7
- data/platform/iphone/Classes/SplitView/LeftViewController.m +25 -7
- data/platform/iphone/Classes/SplitView/RightViewController.h +25 -7
- data/platform/iphone/Classes/SplitView/RightViewController.m +25 -7
- data/platform/iphone/Classes/SplitView/SplitViewDelegate.h +25 -7
- data/platform/iphone/Classes/SplitView/SplitViewDelegate.m +25 -7
- data/platform/iphone/Classes/SplitView/SplittedMainView.h +25 -7
- data/platform/iphone/Classes/SplitView/SplittedMainView.m +29 -7
- data/platform/iphone/Classes/TabbedMainView.h +25 -7
- data/platform/iphone/Classes/TabbedMainView.m +42 -20
- data/platform/iphone/Classes/Utils/ParamsWrapper.h +25 -7
- data/platform/iphone/Classes/Utils/ParamsWrapper.m +25 -7
- data/platform/iphone/Classes/WebView.m +25 -7
- data/platform/iphone/Classes/rho/common/SplashScreenImpl.cpp +25 -8
- data/platform/iphone/Classes/rho/common/SplashScreenImpl.h +25 -8
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +26 -19
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/Tests/Classes/TestsAppDelegate.h +25 -7
- data/platform/iphone/Tests/Classes/TestsAppDelegate.m +25 -7
- data/platform/iphone/main.m +25 -7
- data/platform/iphone/rbuild/findRhodesGuid.rb +26 -0
- data/platform/iphone/rbuild/iphone.rake +42 -6
- data/platform/iphone/rhoextlib/dosyscall.c +26 -0
- data/platform/iphone/rhoextlib/syscall.c +26 -0
- data/platform/iphone/rhoextlib/syscall.h +26 -7
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +2 -0
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +8 -8
- data/platform/linux/Rakefile +26 -0
- data/platform/linux/tasks/linux.rake +26 -0
- data/platform/osx/Rhodes Debugger/DataSource.h +26 -0
- data/platform/osx/Rhodes Debugger/DebugConnection.h +25 -4
- data/platform/osx/Rhodes Debugger/DebuggerController.h +26 -0
- data/platform/osx/Rhodes Debugger/FileSystemItem.h +26 -0
- data/platform/osx/Rhodes Debugger/GdbConnection.h +25 -7
- data/platform/osx/Rhodes Debugger/LogController.h +25 -3
- data/platform/osx/Rhodes Debugger/TcpConnection.h +25 -4
- data/platform/osx/Rhodes Launcher/RhodesController.h +25 -7
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/classes.nib +59 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/info.nib +18 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Resources/qt_menu.nib/keyedobjects.nib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebKit +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Frameworks/phonon.framework/Versions/4/phonon +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +20 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PkgInfo +1 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqgif.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqico.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqjpeg.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqmng.dylib +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/PlugIns/imageformats/libqtiff.dylib +0 -0
- data/platform/{symbian/build/rhologpath.txt → osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/empty.lproj} +0 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/qt.conf +2 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Resources/rho.icns +0 -0
- data/platform/osx/build/osx.rake +88 -0
- data/platform/shared/{SyncClient/SyncClient.cpp → RhoConnectClient/RhoConnectClient.cpp} +78 -52
- data/platform/shared/RhoConnectClient/RhoConnectClient.h +121 -0
- data/platform/shared/RhoConnectClient/RhoError.h +55 -0
- data/platform/shared/common/AppMenu.cpp +26 -0
- data/platform/shared/common/AppMenu.h +26 -0
- data/platform/shared/common/AutoPointer.h +26 -0
- data/platform/shared/common/IRhoBrowser.h +26 -0
- data/platform/shared/common/IRhoClassFactory.h +26 -0
- data/platform/shared/common/IRhoCrypt.h +26 -0
- data/platform/shared/common/IRhoThreadImpl.h +26 -0
- data/platform/shared/common/InputStream.h +26 -0
- data/platform/shared/common/PosixThreadImpl.cpp +31 -0
- data/platform/shared/common/PosixThreadImpl.h +26 -0
- data/platform/shared/common/RhoAppAdapter.h +26 -0
- data/platform/shared/common/RhoConf.cpp +28 -2
- data/platform/shared/common/RhoConf.h +32 -1
- data/platform/shared/common/RhoDefs.h +32 -0
- data/platform/shared/common/RhoFatalError.h +27 -1
- data/platform/shared/common/RhoFile.cpp +30 -4
- data/platform/shared/common/RhoFile.h +26 -0
- data/platform/shared/common/RhoFilePath.h +26 -0
- data/platform/shared/common/RhoMath.cpp +26 -0
- data/platform/shared/common/RhoMath.h +26 -0
- data/platform/shared/common/RhoMutexLock.h +39 -3
- data/platform/shared/common/RhoNativeViewManager.h +26 -0
- data/platform/shared/common/RhoPort.h +55 -17
- data/platform/shared/common/RhoSimConf.cpp +58 -0
- data/platform/shared/common/RhoSimConf.h +62 -0
- data/platform/shared/common/RhoStd.h +26 -0
- data/platform/shared/common/RhoSystem.h +28 -2
- data/platform/shared/common/RhoThread.cpp +26 -0
- data/platform/shared/common/RhoThread.h +26 -0
- data/platform/shared/common/RhoTime.cpp +26 -0
- data/platform/shared/common/RhoTime.h +33 -4
- data/platform/shared/common/RhodesApp.cpp +170 -68
- data/platform/shared/common/RhodesApp.h +34 -6
- data/platform/shared/common/RhodesAppBase.cpp +77 -8
- data/platform/shared/common/RhodesAppBase.h +31 -4
- data/platform/shared/common/SplashScreen.cpp +29 -0
- data/platform/shared/common/SplashScreen.h +26 -0
- data/platform/shared/common/StringConverter.h +26 -0
- data/platform/shared/common/ThreadQueue.cpp +26 -0
- data/platform/shared/common/ThreadQueue.h +26 -0
- data/platform/shared/common/Tokenizer.cpp +26 -0
- data/platform/shared/common/Tokenizer.h +26 -0
- data/platform/shared/common/iphone/RhoClassFactory.cpp +26 -0
- data/platform/shared/common/iphone/RhoClassfactory.h +44 -4
- data/platform/shared/common/iphone/RhoCryptImpl.h +26 -0
- data/platform/shared/common/iphone/RhoCryptImpl.mm +26 -0
- data/platform/shared/common/iphone/RhoFileImpl.m +26 -7
- data/platform/shared/common/iphone/RhoThreadImpl.m +26 -7
- data/platform/shared/common/map/ESRIMapEngine.cpp +26 -0
- data/platform/shared/common/map/ESRIMapEngine.h +26 -0
- data/platform/shared/common/map/GoogleMapEngine.cpp +26 -0
- data/platform/shared/common/map/GoogleMapEngine.h +26 -0
- data/platform/shared/common/map/MapEngine.cpp +28 -2
- data/platform/shared/common/map/MapEngine.h +26 -0
- data/platform/shared/common/rhoparams.cpp +26 -0
- data/platform/shared/common/rhoparams.h +26 -0
- data/platform/shared/common/stat.h +26 -0
- data/platform/shared/curl/lib/config-symbian.h +824 -0
- data/platform/shared/curl/lib/hostip.c +7 -0
- data/platform/shared/curl/lib/http.c +6 -0
- data/platform/shared/curl/lib/setup_once.h +4 -0
- data/platform/shared/db/DBAdapter.cpp +34 -2
- data/platform/shared/db/DBAdapter.h +26 -0
- data/platform/shared/db/DBAttrManager.cpp +26 -0
- data/platform/shared/db/DBAttrManager.h +26 -0
- data/platform/shared/db/DBResult.cpp +26 -0
- data/platform/shared/db/DBResult.h +26 -0
- data/platform/shared/json/JSONIterator.cpp +26 -0
- data/platform/shared/json/JSONIterator.h +26 -0
- data/platform/shared/json/RJSONTokener.c +3 -3
- data/platform/shared/json/json.h +1 -1
- data/platform/shared/json/{debug.c → json_debug.c} +2 -2
- data/platform/shared/json/{debug.h → json_debug.h} +1 -1
- data/platform/shared/json/json_object.c +1 -1
- data/platform/shared/json/json_tokener.c +1 -1
- data/platform/shared/json/json_util.c +1 -1
- data/platform/shared/json/printbuf.c +1 -1
- data/platform/shared/logging/RhoATLTrace.h +26 -0
- data/platform/shared/logging/RhoLog.cpp +90 -0
- data/platform/shared/logging/RhoLog.h +29 -1
- data/platform/shared/logging/RhoLogCat.h +26 -0
- data/platform/shared/logging/RhoLogConf.cpp +72 -10
- data/platform/shared/logging/RhoLogConf.h +39 -5
- data/platform/shared/logging/RhoLogSink.cpp +26 -0
- data/platform/shared/logging/RhoLogSink.h +26 -0
- data/platform/shared/logging/RhoPlainLog.cpp +36 -8
- data/platform/shared/logging/test/TestLog.cpp +26 -0
- data/platform/shared/logging/test/TestPlainLog.c +26 -0
- data/platform/shared/logging/test/main.cpp +26 -0
- data/platform/shared/net/AsyncHttp.cpp +27 -0
- data/platform/shared/net/AsyncHttp.h +28 -1
- data/platform/shared/net/CURLNetRequest.cpp +81 -11
- data/platform/shared/net/CURLNetRequest.h +30 -0
- data/platform/shared/net/CompatWince.cpp +26 -0
- data/platform/shared/net/CompatWince.h +26 -0
- data/platform/shared/net/HttpServer.cpp +82 -23
- data/platform/shared/net/HttpServer.h +27 -1
- data/platform/shared/net/INetRequest.cpp +26 -0
- data/platform/shared/net/INetRequest.h +26 -0
- data/platform/shared/net/RawSocket.cpp +38 -12
- data/platform/shared/net/RawSocket.h +28 -2
- data/platform/shared/net/URI.cpp +26 -6
- data/platform/shared/net/URI.h +26 -2
- data/platform/shared/net/iphone/sslimpl.cpp +39 -10
- data/platform/shared/net/iphone/sslimpl.h +25 -8
- data/platform/shared/net/ssl.cpp +26 -0
- data/platform/shared/net/ssl.h +26 -0
- data/platform/shared/qt/RhoSimulator.pro +7 -0
- data/platform/shared/qt/curl/curl.pro +181 -0
- data/platform/shared/qt/pbxproj2pro.pl +21 -0
- data/platform/shared/qt/pro_vcproj_diff.pl +59 -0
- data/platform/shared/qt/rhodes/DateTimeDialog.cpp +91 -0
- data/platform/shared/qt/rhodes/DateTimeDialog.h +54 -0
- data/platform/shared/qt/rhodes/DateTimeDialog.ui +68 -0
- data/platform/shared/qt/rhodes/ExternalWebView.cpp +46 -0
- data/platform/shared/qt/rhodes/ExternalWebView.h +49 -0
- data/platform/{wm/rhodes/emulator → shared/qt/rhodes}/ExternalWebView.ui +0 -0
- data/platform/shared/qt/rhodes/MainWindowCallback.h +51 -0
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +819 -0
- data/platform/shared/qt/rhodes/QtMainWindow.h +148 -0
- data/platform/{wm/rhodes/emulator → shared/qt/rhodes}/QtMainWindow.ui +13 -1
- data/platform/shared/qt/rhodes/QtNativeTabBar.cpp +112 -0
- data/platform/shared/qt/rhodes/QtNativeTabBar.h +37 -0
- data/platform/shared/qt/rhodes/QtWebInspector.cpp +71 -0
- data/platform/shared/qt/rhodes/QtWebInspector.h +53 -0
- data/platform/shared/qt/rhodes/QtWebInspector.ui +41 -0
- data/platform/shared/qt/rhodes/impl/AlertImpl.cpp +153 -0
- data/platform/shared/qt/rhodes/impl/AlertImpl.h +65 -0
- data/platform/shared/qt/rhodes/impl/BluetoothImpl.cpp +109 -0
- data/platform/shared/qt/rhodes/impl/CalendarImpl.cpp +52 -0
- data/platform/shared/qt/rhodes/impl/CameraImpl.cpp +54 -0
- data/platform/shared/qt/rhodes/impl/DateTimePickerImpl.cpp +61 -0
- data/platform/shared/qt/rhodes/impl/DateTimePickerImpl.h +70 -0
- data/platform/shared/qt/rhodes/impl/GeoLocationImpl.cpp +65 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +727 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +160 -0
- data/platform/shared/qt/rhodes/impl/MapViewImpl.cpp +60 -0
- data/platform/shared/qt/rhodes/impl/NativeTabbarImpl.cpp +131 -0
- data/platform/shared/qt/rhodes/impl/NativeTabbarImpl.h +96 -0
- data/platform/shared/qt/rhodes/impl/NativeToolbarImpl.cpp +124 -0
- data/platform/shared/qt/rhodes/impl/NativeToolbarImpl.h +71 -0
- data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +103 -0
- data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.cpp +56 -0
- data/platform/shared/qt/rhodes/impl/RhoClassFactoryImpl.h +82 -0
- data/platform/shared/qt/rhodes/impl/RhoFileImpl.cpp +63 -0
- data/platform/shared/qt/rhodes/impl/RhoNativeViewManagerImpl.cpp +86 -0
- data/platform/shared/qt/rhodes/impl/RhoThreadImpl.cpp +114 -0
- data/platform/shared/qt/rhodes/impl/RhoThreadImpl.h +72 -0
- data/platform/shared/qt/rhodes/impl/RhodesImpl.cpp +193 -0
- data/platform/shared/qt/rhodes/impl/RingtoneManagerImpl.cpp +51 -0
- data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +43 -0
- data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +229 -0
- data/platform/shared/qt/rhodes/impl/WebViewImpl.cpp +114 -0
- data/platform/shared/qt/rhodes/main.cpp +208 -0
- data/platform/shared/qt/rhodes/resources/rho.icns +0 -0
- data/platform/shared/qt/rhodes/resources/rho.ico +0 -0
- data/platform/shared/qt/rhodes/rhodes.pro +133 -0
- data/platform/shared/qt/rholib/rholib.pro +138 -0
- data/platform/shared/qt/rubylib/rubylib.pro +183 -0
- data/platform/shared/qt/sqlite3/sqlite3.pro +40 -0
- data/platform/shared/qt/syncengine/syncengine.pro +82 -0
- data/platform/shared/ruby/ext/alert/alert.i +13 -5
- data/platform/shared/ruby/ext/alert/alert_wrap.c +100 -11
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +391 -111
- data/platform/shared/ruby/ext/bluetooth/bluetooth.i +28 -14
- data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +311 -424
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +2278 -2278
- data/platform/shared/ruby/ext/calendar/event_wrap.c +2152 -2151
- data/platform/shared/ruby/ext/camera/camera.i +22 -2
- data/platform/shared/ruby/ext/camera/camera_wrap.c +448 -115
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +404 -126
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +17 -14
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +384 -104
- data/platform/shared/ruby/ext/nativebar/nativebar.i +0 -3
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +0 -35
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +5 -5
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +384 -104
- data/platform/shared/ruby/ext/phonebook/phonebook.h +26 -0
- data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +422 -144
- data/platform/shared/ruby/ext/rho/rhoruby.c +56 -13
- data/platform/shared/ruby/ext/rho/rhoruby.h +30 -10
- data/platform/shared/ruby/ext/rho/rhosupport.c +106 -33
- data/platform/shared/ruby/ext/rhoconf/rhoconf.i +6 -2
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +24 -8
- data/platform/shared/ruby/ext/ringtones/ringtones_wrap.c +389 -109
- data/platform/shared/ruby/ext/signature/signature.i +1 -1
- data/platform/shared/ruby/ext/signature/signature_wrap.c +5 -5
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +26 -0
- data/platform/shared/ruby/ext/syncengine/syncengine.i +4 -0
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +25 -5
- data/platform/shared/ruby/ext/system/system_wrap.c +3 -3
- data/platform/shared/ruby/ext/webview/webview.i +4 -0
- data/platform/shared/ruby/ext/webview/webview_wrap.c +428 -134
- data/platform/shared/ruby/gc.c +4 -0
- data/platform/shared/ruby/hash.c +3 -0
- data/platform/shared/ruby/include/ruby/defines.h +20 -1
- data/platform/shared/ruby/include/ruby/intern.h +2 -0
- data/platform/shared/ruby/include/ruby/ruby.h +7 -4
- data/platform/shared/ruby/io.c +2 -1
- data/platform/shared/ruby/iphone/ruby/config.h +2 -0
- data/platform/shared/ruby/missing/dup2.c +1 -0
- data/platform/shared/ruby/signal.c +5 -5
- data/platform/shared/ruby/symbian/assert.h +2 -2
- data/platform/shared/ruby/symbian/ruby/config.h +13 -3
- data/platform/shared/ruby/symbian/symbian.h +2 -2
- data/platform/shared/ruby/thread_pthread.c +1 -1
- data/platform/shared/ruby/win32/assert.h +27 -1
- data/platform/shared/rubyext/GeoLocation.cpp +26 -0
- data/platform/shared/rubyext/GeoLocation.h +26 -0
- data/platform/shared/rubyext/NativeToolbarExt.h +35 -0
- data/platform/shared/rubyext/RhoAppAdapter.cpp +26 -0
- data/platform/shared/rubyext/System.cpp +54 -1
- data/platform/shared/rubyext/WebView.h +26 -0
- data/platform/shared/sqlite/crypto.c +26 -0
- data/platform/shared/sqlite/sqlite3.c +9706 -4596
- data/platform/shared/sqlite/sqlite3.h +521 -119
- data/platform/shared/statistic/RhoProfiler.cpp +26 -0
- data/platform/shared/statistic/RhoProfiler.h +26 -0
- data/platform/shared/statistic/test/TestProfiling.cpp +26 -0
- data/platform/shared/sync/ClientRegister.cpp +29 -1
- data/platform/shared/sync/ClientRegister.h +26 -0
- data/platform/shared/sync/ISyncProtocol.h +27 -1
- data/platform/shared/sync/SyncEngine.cpp +26 -0
- data/platform/shared/sync/SyncEngine.h +27 -1
- data/platform/shared/sync/SyncNotify.cpp +28 -1
- data/platform/shared/sync/SyncNotify.h +26 -0
- data/platform/shared/sync/SyncProtocol_3.h +34 -6
- data/platform/shared/sync/SyncSource.cpp +52 -17
- data/platform/shared/sync/SyncSource.h +26 -0
- data/platform/shared/sync/SyncThread.cpp +41 -0
- data/platform/shared/sync/SyncThread.h +27 -2
- data/platform/shared/sync/Test/NetDataStub.h +26 -0
- data/platform/shared/sync/Test/SyncEngine_test.cpp +26 -0
- data/platform/shared/sync/Test/SyncSource_test.cpp +26 -0
- data/platform/shared/tcmalloc/rhomem.h +1 -1
- data/platform/shared/test/Tests.cpp +28 -2
- data/platform/shared/test/test_helper.cpp +26 -0
- data/platform/shared/test/test_helper.h +26 -0
- data/platform/shared/unzip/unzip.cpp +10 -4
- data/platform/shared/unzip/unzip.h +8 -0
- data/platform/shared/xruby/src/com/xruby/compiler/parser/RubyParser.java +97 -97
- data/platform/symbian/build/symbian.rake +202 -0
- data/platform/symbian/curl/curl.pro +179 -0
- data/platform/symbian/qtscroller/include/QtScrollEvent +5 -0
- data/platform/symbian/qtscroller/include/QtScrollPrepareEvent +5 -0
- data/platform/symbian/qtscroller/include/QtScroller +5 -0
- data/platform/symbian/qtscroller/include/QtScrollerProperties +5 -0
- data/platform/symbian/qtscroller/qtscroller.pri +13 -0
- data/platform/symbian/qtscroller/qtscroller.pro +3 -0
- data/platform/symbian/qtscroller/src/qtflickgesture.cpp +696 -0
- data/platform/symbian/qtscroller/src/qtflickgesture_p.h +107 -0
- data/platform/symbian/qtscroller/src/qtscroller.cpp +2081 -0
- data/platform/symbian/qtscroller/src/qtscroller.h +138 -0
- data/platform/symbian/qtscroller/src/qtscroller_p.h +206 -0
- data/platform/symbian/qtscroller/src/qtscrollerfilter.cpp +351 -0
- data/platform/symbian/qtscroller/src/qtscrollerfilter_p.h +111 -0
- data/platform/symbian/qtscroller/src/qtscrollerproperties.cpp +413 -0
- data/platform/symbian/qtscroller/src/qtscrollerproperties.h +135 -0
- data/platform/symbian/qtscroller/src/qtscrollerproperties_p.h +91 -0
- data/platform/symbian/qtscroller/src/qtscrollevent.cpp +191 -0
- data/platform/symbian/qtscroller/src/qtscrollevent.h +100 -0
- data/platform/symbian/qtscroller/src/qtscrollevent_p.h +33 -0
- data/platform/symbian/qtscroller/src/src.pro +24 -0
- data/platform/symbian/rhodes.pro +4 -0
- data/platform/symbian/rhodes.sln +72 -0
- data/platform/symbian/rhodes/deployment.pri +115 -0
- data/platform/symbian/rhodes/rhodes.pro +141 -0
- data/platform/symbian/rhodes/rhodes.vcproj +385 -0
- data/platform/symbian/rhodes/{inc → src}/ContactsConstants.h +0 -0
- data/platform/symbian/rhodes/src/RhoThreadImpl.cpp +19 -0
- data/platform/symbian/rhodes/src/phonebook/Phonebook.cpp +19 -19
- data/platform/symbian/rhodes/{inc → src}/phonebook/Phonebook.h +1 -1
- data/platform/symbian/rhodes/src/qkineticscroller.cpp +1245 -0
- data/platform/symbian/rhodes/src/qkineticscroller.h +165 -0
- data/platform/symbian/rhodes/src/qkineticscroller_p.h +168 -0
- data/platform/symbian/rhodes/src/qwebviewkineticscroller.cpp +347 -0
- data/platform/symbian/rhodes/src/qwebviewkineticscroller.h +89 -0
- data/platform/symbian/rhodes/src/qwebviewselectionsuppressor.h +113 -0
- data/platform/symbian/rhodes_win32.pro +4 -0
- data/platform/symbian/rholib/rholib.pro +108 -0
- data/platform/symbian/rholib/rholib.vcproj +1466 -0
- data/platform/symbian/rubylib/rubylib.pro +163 -0
- data/platform/symbian/rubylib/rubylib.vcproj +1166 -0
- data/platform/symbian/rubylib/src/symbian_stubs.c +45 -3
- data/platform/symbian/sqlite3/sqlite3.pro +38 -0
- data/platform/symbian/sqlite3/sqlite3.vcproj +254 -0
- data/platform/symbian/{SQLite60 → sqlite3}/src/mutex.cpp +0 -0
- data/platform/symbian/{SQLite60 → sqlite3}/src/os_symbian.cpp +0 -0
- data/platform/symbian/{SQLite60 → sqlite3}/src/os_symbian.h +0 -0
- data/platform/symbian/{SQLite60 → sqlite3}/src/sqlite3.c +1 -0
- data/platform/symbian/{SQLite60 → sqlite3}/src/sqlite3.h +0 -0
- data/platform/symbian/syncengine/syncengine.pro +64 -0
- data/platform/symbian/syncengine/syncengine.vcproj +842 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/win32/replaceicon/replaceicon.cpp +25 -2
- data/platform/win32/replaceicon/stdafx.cpp +25 -3
- data/platform/win32/replaceicon/stdafx.h +25 -4
- data/platform/win32/updateresstring/stdafx.cpp +25 -3
- data/platform/win32/updateresstring/stdafx.h +25 -4
- data/platform/win32/updateresstring/updateresstring.cpp +25 -2
- data/platform/wm/RhoLib/RhoLib.vcproj +38 -8
- data/platform/wm/build/wm.rake +92 -76
- data/platform/wm/rhodes.sln +139 -139
- data/platform/wm/rhodes/Alert.cpp +31 -5
- data/platform/wm/rhodes/Alert.h +27 -1
- data/platform/wm/rhodes/AppManager.cpp +26 -0
- data/platform/wm/rhodes/AppManager.h +26 -0
- data/platform/wm/rhodes/DateTimePicker.cpp +26 -0
- data/platform/wm/rhodes/DateTimePicker.h +30 -0
- data/platform/wm/rhodes/LogOptionsDlg.cpp +26 -0
- data/platform/wm/rhodes/LogOptionsDlg.h +26 -0
- data/platform/wm/rhodes/LogView.cpp +26 -2
- data/platform/wm/rhodes/LogView.h +25 -1
- data/platform/wm/rhodes/Macros.h +25 -1
- data/platform/wm/rhodes/MainWindow.cpp +37 -2
- data/platform/wm/rhodes/MainWindow.h +29 -2
- data/platform/wm/rhodes/MapView/Graphics.cpp +25 -1
- data/platform/wm/rhodes/MapView/Graphics.h +26 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +26 -0
- data/platform/wm/rhodes/MapView/MapViewManager.h +25 -0
- data/platform/wm/rhodes/MetaHandler.cpp +26 -0
- data/platform/wm/rhodes/MetaHandler.h +26 -0
- data/platform/wm/rhodes/OkCancelModalDialog.h +26 -0
- data/platform/wm/rhodes/OutlookApp.cpp +26 -0
- data/platform/wm/rhodes/OutlookApp.h +26 -0
- data/platform/wm/rhodes/RhoNativeViewManager.cpp +26 -0
- data/platform/wm/rhodes/RhoNativeViewManagerWM.h +25 -8
- data/platform/wm/rhodes/Rhodes.cpp +127 -24
- data/platform/wm/rhodes/RingtoneManager.cpp +26 -0
- data/platform/wm/rhodes/RingtoneManager.h +26 -0
- data/platform/wm/rhodes/SyncStatusDlg.cpp +26 -0
- data/platform/wm/rhodes/SyncStatusDlg.h +26 -0
- data/platform/wm/rhodes/Utils.cpp +26 -0
- data/platform/wm/rhodes/Utils.h +26 -0
- data/platform/wm/rhodes/Vibrate.cpp +30 -9
- data/platform/wm/rhodes/Vibrate.h +27 -2
- data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +63 -4
- data/platform/wm/rhodes/bluetooth/Bluetooth.h +32 -1
- data/platform/wm/rhodes/camera/Camera.cpp +40 -6
- data/platform/wm/rhodes/camera/Camera.h +32 -1
- data/platform/wm/rhodes/memory_helper.cpp +26 -0
- data/platform/wm/rhodes/menubar.cpp +26 -0
- data/platform/wm/rhodes/menubar.h +26 -0
- data/platform/wm/rhodes/phonebook/NativeAddressBook.cpp +26 -0
- data/platform/wm/rhodes/phonebook/NativeAddressBook.h +26 -0
- data/platform/wm/rhodes/phonebook/phonebook.cpp +26 -8
- data/platform/wm/rhodes/phonebook/phonebook.h +26 -8
- data/platform/wm/rhodes/resource.h +1 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.cpp +26 -0
- data/platform/wm/rhodes/rho/common/RhoClassFactory.h +26 -0
- data/platform/wm/rhodes/rho/common/RhoCryptImpl.cpp +26 -0
- data/platform/wm/rhodes/rho/common/RhoCryptImpl.h +26 -0
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.cpp +26 -0
- data/platform/wm/rhodes/rho/common/RhoThreadImpl.h +26 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +30 -1
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +29 -0
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +26 -0
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +26 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +27 -1
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.h +26 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbarExt.cpp +71 -7
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +36 -4
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +48 -2
- data/platform/wm/rhodes/rho/rubyext/calendar.cpp +26 -0
- data/platform/wm/rhodes/rhodes.vcproj +2491 -579
- data/platform/wm/rhodes/signature/Signature.cpp +26 -0
- data/platform/wm/rhodes/signature/Signature.h +26 -0
- data/platform/wm/rhodes/simulator/MainWindowQt.cpp +852 -0
- data/platform/wm/rhodes/{emulator → simulator}/MainWindowQt.h +76 -11
- data/platform/wm/rhodes/simulator/NativeTabbarQt.cpp +91 -0
- data/platform/wm/rhodes/simulator/NativeTabbarQt.h +102 -0
- data/platform/wm/rhodes/simulator/NativeToolbarQt.cpp +82 -0
- data/platform/wm/rhodes/simulator/NativeToolbarQt.h +78 -0
- data/platform/wm/rhodes/stdafx.cpp +25 -16
- data/platform/wm/rhodes/stdafx.h +26 -4
- data/platform/wm/rubylib/rubylib.vcproj +94 -78
- data/platform/wm/sqlite3/sqlite3.vcproj +8 -8
- data/platform/wm/syncengine/syncengine.vcproj +33 -11
- data/platform/wm/tools/detool/LogServer.cpp +33 -3
- data/platform/wm/tools/detool/LogServer.h +29 -1
- data/platform/wm/tools/detool/detool.cpp +105 -14
- data/platform/wm/tools/detool/detool.h +26 -0
- data/platform/wm/tools/detool/detool.vcproj +243 -242
- data/platform/wm/tools/detool/stdafx.cpp +25 -3
- data/platform/wm/tools/detool/stdafx.h +26 -0
- data/platform/wm/tools/detool/targetver.h +26 -0
- data/platform/wm/tools/rhosetup/rhosetup.cpp +25 -2
- data/platform/wm/tools/rhosetup/stdafx.cpp +25 -3
- data/platform/wm/tools/rhosetup/stdafx.h +25 -4
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.Libraries.dll +0 -0
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.dll +0 -0
- data/platform/wp7/RhoAppRunner/Program.cs +27 -1
- data/platform/wp7/RhoLogServer/Program.cs +27 -1
- data/platform/wp7/RhoLogServer/SocketServer.cs +27 -1
- data/platform/wp7/RhoRubyExtGen/RhoAsyncHttp.cs +27 -1
- data/platform/wp7/RhoRubyExtGen/RhoConfig.cs +84 -0
- data/platform/wp7/RhoRubyExtGen/RhoDatabase.cs +27 -1
- data/platform/wp7/RhoRubyExtGen/RhoJSON.cs +26 -0
- data/platform/wp7/RhoRubyExtGen/RhoNativeBar.cs +35 -3
- data/platform/wp7/RhoRubyExtGen/RhoRubyExtGen.csproj +2 -0
- data/platform/wp7/RhoRubyExtGen/RhoSyncEngine.cs +34 -2
- data/platform/wp7/RhoRubyExtGen/RhoSystem.cs +144 -0
- data/platform/wp7/RhoRubyExtGen/RhoWebView.cs +33 -2
- data/platform/wp7/RhoRubyLib/Initializers.Generated.cs +149 -5
- data/platform/wp7/RhoRubyLib/RhoAppAdapter.cs +27 -1
- data/platform/wp7/RhoRubyLib/RhoRuby.cs +27 -1
- data/platform/wp7/RhoRubyLib/RhoRubyLib.csproj +24 -1
- data/platform/wp7/RhoRubyLib/WP_PlatformAdaptationLayer.cs +26 -15
- data/platform/wp7/RhoRubyLib/common/IInputStream.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/Mutex.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoConf.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoEmptyProfiler.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoFile.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoFilePath.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoParamArray.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoParams.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoProfiler.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoResourceMap.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoStd.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhoThread.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +232 -16
- data/platform/wp7/RhoRubyLib/common/ThreadQueue.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/TimeInterval.cs +27 -1
- data/platform/wp7/RhoRubyLib/common/Tokenizer.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/DBAdapter.cs +33 -1
- data/platform/wp7/RhoRubyLib/db/DBAttrManager.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/DBCommand.cs +428 -0
- data/platform/wp7/RhoRubyLib/db/DBException.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/IDBCallback.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/IDBResult.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/IDBStorage.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/SqliteCopyResult.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/SqliteResult.cs +27 -1
- data/platform/wp7/RhoRubyLib/db/SqliteStorage.cs +27 -1
- data/platform/wp7/RhoRubyLib/json/JSONArrayIterator.cs +27 -1
- data/platform/wp7/RhoRubyLib/json/JSONEntry.cs +27 -1
- data/platform/wp7/RhoRubyLib/json/JSONStructIterator.cs +27 -1
- data/platform/wp7/RhoRubyLib/json/JsonParser.cs +26 -0
- data/platform/wp7/RhoRubyLib/json/RJSONTokener.cs +26 -0
- data/platform/wp7/RhoRubyLib/logging/IRhoLogSink.cs +27 -1
- data/platform/wp7/RhoRubyLib/logging/RhoEmptyLogger.cs +26 -0
- data/platform/wp7/RhoRubyLib/logging/RhoLogConf.cs +27 -1
- data/platform/wp7/RhoRubyLib/logging/RhoLogFileSink.cs +27 -1
- data/platform/wp7/RhoRubyLib/logging/RhoLogServerSink.cs +27 -1
- data/platform/wp7/RhoRubyLib/logging/RhoLogger.cs +27 -1
- data/platform/wp7/RhoRubyLib/net/AsyncHttp.cs +27 -1
- data/platform/wp7/RhoRubyLib/net/HttpServer.cs +28 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +28 -2
- data/platform/wp7/RhoRubyLib/net/NetResponse.cs +27 -1
- data/platform/wp7/RhoRubyLib/net/URI.cs +27 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoAsyncHttp.cs +27 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoConfig.cs +188 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoDatabase.cs +27 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoJSON.cs +26 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoKernelOps.cs +27 -1
- data/platform/wp7/RhoRubyLib/rubyext/RhoNativeBar.cs +130 -6
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +42 -2
- data/platform/wp7/RhoRubyLib/rubyext/RhoSystem.cs +153 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoWebView.cs +49 -4
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +17 -17
- data/platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml +18 -0
- data/platform/wp7/RhoRubyLib/views/RhoTabHeader.xaml.cs +56 -0
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml +16 -0
- data/platform/wp7/RhoRubyLib/views/RhoView.xaml.cs +153 -0
- data/platform/wp7/build/wp.rake +31 -0
- data/platform/wp7/rhodes/App.xaml.cs +28 -2
- data/platform/wp7/rhodes/MainPage.xaml +4 -3
- data/platform/wp7/rhodes/MainPage.xaml.cs +50 -11
- data/platform/wp7/sqlite3/SQLiteClient.cs +27 -1
- data/rakefile.rb +200 -18
- data/res/build-tools/detool.exe +0 -0
- data/res/generators/rhogen.rb +2 -1
- data/res/generators/templates/application/app/Settings/home.bb.erb +14 -13
- data/res/generators/templates/application/app/Settings/home.erb +16 -17
- data/res/generators/templates/application/app/Settings/index.bb.erb +26 -27
- data/res/generators/templates/application/app/Settings/index.erb +28 -27
- data/res/generators/templates/application/app/Settings/login.bb.erb +25 -31
- data/res/generators/templates/application/app/Settings/login.erb +20 -22
- data/res/generators/templates/application/app/Settings/reset.bb.erb +12 -11
- data/res/generators/templates/application/app/Settings/reset.erb +10 -13
- data/res/generators/templates/application/app/Settings/wait.bb.erb +9 -2
- data/res/generators/templates/application/app/Settings/wait.erb +9 -4
- data/res/generators/templates/application/app/index.erb +17 -24
- data/res/generators/templates/application/app/layout.erb +51 -21
- data/res/generators/templates/application/build.yml +3 -1
- data/res/generators/templates/application/icon/icon.svg +5334 -0
- data/res/generators/templates/application/public/css/android.css +6 -1
- data/res/generators/templates/application/public/css/blackberry.css +6 -1
- data/res/generators/templates/application/public/css/iphone.css +4 -0
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icon-search-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
- data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.css +1661 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.js +5626 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.min.css +8 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.min.js +146 -0
- data/res/generators/templates/application/public/{jqtouch/jqtouch-iphone.css → jqmobile/jquery.mobile.iphone.css} +1 -1
- data/res/generators/templates/application/public/jquery/jquery-1.6.2.js +8981 -0
- data/res/generators/templates/application/public/jquery/jquery-1.6.2.min.js +18 -0
- data/res/generators/templates/application/public/js/jqmobile-patch.js +231 -0
- data/res/generators/templates/model/controller.rb +3 -2
- data/res/generators/templates/model/edit.bb.erb +17 -17
- data/res/generators/templates/model/edit.erb +15 -20
- data/res/generators/templates/model/index.bb.erb +19 -19
- data/res/generators/templates/model/index.erb +23 -26
- data/res/generators/templates/model/new.bb.erb +18 -19
- data/res/generators/templates/model/new.erb +17 -19
- data/res/generators/templates/model/show.bb.erb +10 -11
- data/res/generators/templates/model/show.erb +16 -19
- data/rhobuild.yml.example +2 -1
- data/rhodes.gemspec +4 -3
- data/rhomobile-debug.gemspec +22 -0
- data/spec/framework_spec/app/layout.erb +1 -1
- data/spec/perfomance_spec/app/layout.erb +1 -1
- data/spec/phone_spec/app/spec/asynchttp_spec.rb +1 -1
- data/spec/phone_spec/app/spec/mapview_spec.rb +43 -0
- data/spec/phone_spec/app/spec/rho_spec.rb +23 -0
- data/spec/phone_spec/app/spec/syncengine_spec.rb +49 -8
- metadata +244 -344
- data/Manifest.txt +0 -6409
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/COPYING +0 -27
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/README +0 -95
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar.h +0 -1415
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Decoder.h +0 -201
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Exception.h +0 -187
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Image.h +0 -321
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ImageScanner.h +0 -130
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Processor.h +0 -223
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/QZBar.h +0 -169
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/QZBarImage.h +0 -72
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Scanner.h +0 -162
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Symbol.h +0 -529
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Video.h +0 -170
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/Window.h +0 -136
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarCaptureReader.h +0 -99
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarImage.h +0 -69
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarImageScanner.h +0 -50
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarReaderController.h +0 -142
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarReaderView.h +0 -119
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarReaderViewController.h +0 -99
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/ZBarSymbol.h +0 -67
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/include/zbar/zbargtk.h +0 -205
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/config.c +0 -157
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/convert.c +0 -1172
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/debug.h +0 -87
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder.c +0 -409
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder.h +0 -219
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/code128.c +0 -528
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/code128.h +0 -49
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/code39.c +0 -335
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/code39.h +0 -50
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/ean.c +0 -660
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/ean.h +0 -86
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/i25.c +0 -243
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/i25.h +0 -50
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/pdf417.c +0 -223
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/pdf417.h +0 -49
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/pdf417_hash.h +0 -545
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/qr_finder.c +0 -102
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/decoder/qr_finder.h +0 -23
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/error.c +0 -183
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/error.h +0 -240
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/event.h +0 -62
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/image.c +0 -358
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/image.h +0 -142
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/img_scanner.c +0 -819
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/img_scanner.h +0 -38
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/jpeg.c +0 -241
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/mutex.h +0 -160
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor.c +0 -700
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor.h +0 -126
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/lock.c +0 -227
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/null.c +0 -62
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/posix.c +0 -337
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/posix.h +0 -138
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/win.c +0 -335
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/processor/x.c +0 -269
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode.h +0 -66
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/bch15_5.c +0 -184
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/bch15_5.h +0 -20
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/binarize.c +0 -639
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/binarize.h +0 -17
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/isaac.c +0 -139
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/isaac.h +0 -41
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/qrdec.c +0 -3957
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/qrdec.h +0 -168
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/qrdectxt.c +0 -405
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/rs.c +0 -799
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/rs.h +0 -66
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/util.c +0 -140
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/qrcode/util.h +0 -48
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/refcnt.c +0 -48
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/refcnt.h +0 -96
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/scanner.c +0 -317
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/svg.c +0 -184
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/svg.h +0 -65
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/symbol.c +0 -325
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/symbol.h +0 -93
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/thread.h +0 -127
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/timer.h +0 -151
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/unistd.h +0 -1
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video.c +0 -384
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video.h +0 -160
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video/null.c +0 -37
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video/v4l1.c +0 -435
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video/v4l2.c +0 -509
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/video/vfw.c +0 -494
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window.c +0 -318
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window.h +0 -144
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/dib.c +0 -75
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/null.c +0 -103
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/vfw.c +0 -104
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/win.c +0 -334
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/win.h +0 -46
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/x.c +0 -356
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/x.h +0 -74
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/ximage.c +0 -219
- data/lib/extensions/barcode/ext/barcode/shared/zbar/zbar/zbar/window/xv.c +0 -273
- data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_SplashScreen.h +0 -39
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkConnectivityListener.java +0 -222
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NetworkStateTracker.java +0 -185
- data/platform/shared/SyncClient/RhoError.h +0 -29
- data/platform/shared/SyncClient/SyncClient.h +0 -95
- data/platform/symbian/RhoLib/group/RhoLib.mmp +0 -41
- data/platform/symbian/RhoLib/group/bld.inf +0 -15
- data/platform/symbian/SQLite60/group/SQLite60.mmp +0 -21
- data/platform/symbian/SQLite60/group/bld.inf +0 -7
- data/platform/symbian/build/build.properties +0 -80
- data/platform/symbian/build/build.xml +0 -649
- data/platform/symbian/build/insertRhoBundle2pkg.rb +0 -26
- data/platform/symbian/build/lib/stlport.zip +0 -0
- data/platform/symbian/build/logfile.template +0 -1
- data/platform/symbian/build/release.properties +0 -7
- data/platform/symbian/lib/pips_nokia_1_3_ss.sis +0 -0
- data/platform/symbian/rhodes/data/loading.html +0 -11
- data/platform/symbian/rhodes/data/rhodes.rls +0 -91
- data/platform/symbian/rhodes/data/rhodes.rss +0 -537
- data/platform/symbian/rhodes/data/rhodes_reg.rss +0 -40
- data/platform/symbian/rhodes/gfx/qgn_menu_rhodes.svg +0 -55
- data/platform/symbian/rhodes/group/Icons_scalable_dc.mk +0 -50
- data/platform/symbian/rhodes/group/bld.inf +0 -10
- data/platform/symbian/rhodes/group/rhodes.mmp +0 -180
- data/platform/symbian/rhodes/help/Custom.xml +0 -18
- data/platform/symbian/rhodes/help/build_help.mk +0 -45
- data/platform/symbian/rhodes/help/rhodes.cshlp +0 -19
- data/platform/symbian/rhodes/help/rhodes.xml +0 -13
- data/platform/symbian/rhodes/inc/AppManager.h +0 -89
- data/platform/symbian/rhodes/inc/AppSoftkeysObserver.h +0 -95
- data/platform/symbian/rhodes/inc/ConnectionManager.h +0 -115
- data/platform/symbian/rhodes/inc/GeoLocationService.h +0 -89
- data/platform/symbian/rhodes/inc/HttpClient.h +0 -161
- data/platform/symbian/rhodes/inc/HttpConstants.h +0 -72
- data/platform/symbian/rhodes/inc/HttpEventHandler.h +0 -130
- data/platform/symbian/rhodes/inc/HttpFileManager.h +0 -116
- data/platform/symbian/rhodes/inc/HttpServer.h +0 -119
- data/platform/symbian/rhodes/inc/LogOptionsDialog.h +0 -59
- data/platform/symbian/rhodes/inc/RhoCamera.h +0 -321
- data/platform/symbian/rhodes/inc/SpecialLoadObserver.h +0 -115
- data/platform/symbian/rhodes/inc/SyncEngineWrap.h +0 -107
- data/platform/symbian/rhodes/inc/geolocation/GeoLocation.h +0 -91
- data/platform/symbian/rhodes/inc/ports_mngt.h +0 -23
- data/platform/symbian/rhodes/inc/posix_http_client.h +0 -37
- data/platform/symbian/rhodes/inc/rhodes.hrh +0 -106
- data/platform/symbian/rhodes/inc/rhodes.pan +0 -42
- data/platform/symbian/rhodes/inc/rhodesAppUi.h +0 -153
- data/platform/symbian/rhodes/inc/rhodesAppView.h +0 -242
- data/platform/symbian/rhodes/inc/rhodesApplication.h +0 -69
- data/platform/symbian/rhodes/inc/rhodesDocument.h +0 -103
- data/platform/symbian/rhodes/sis/backup_registration.xml +0 -5
- data/platform/symbian/rhodes/sis/cert/rhodes_cert.cer +0 -27
- data/platform/symbian/rhodes/sis/cert/rhodes_pid.key +0 -23
- data/platform/symbian/rhodes/sis/rhodes.pkg +0 -42
- data/platform/symbian/rhodes/src/AppManager.cpp +0 -153
- data/platform/symbian/rhodes/src/AppSoftkeysObserver.cpp +0 -88
- data/platform/symbian/rhodes/src/ConnectionManager.cpp +0 -337
- data/platform/symbian/rhodes/src/GeoLocationService.cpp +0 -151
- data/platform/symbian/rhodes/src/HttpClient.cpp +0 -489
- data/platform/symbian/rhodes/src/HttpConstants.cpp +0 -35
- data/platform/symbian/rhodes/src/HttpEventHandler.cpp +0 -587
- data/platform/symbian/rhodes/src/HttpFileManager.cpp +0 -282
- data/platform/symbian/rhodes/src/HttpServer.cpp +0 -275
- data/platform/symbian/rhodes/src/LogOptionsDialog.cpp +0 -179
- data/platform/symbian/rhodes/src/RhoCamera.cpp +0 -675
- data/platform/symbian/rhodes/src/SpecialLoadObserver.cpp +0 -95
- data/platform/symbian/rhodes/src/SyncEngineWrap.cpp +0 -400
- data/platform/symbian/rhodes/src/camera/camera.cpp +0 -23
- data/platform/symbian/rhodes/src/geolocation/GeoLocation.cpp +0 -110
- data/platform/symbian/rhodes/src/geolocation/ruby_geolocation.cpp +0 -38
- data/platform/symbian/rhodes/src/notification.cpp +0 -117
- data/platform/symbian/rhodes/src/ports_mngt.c +0 -103
- data/platform/symbian/rhodes/src/posix_http_client.c +0 -460
- data/platform/symbian/rhodes/src/rhodes.cpp +0 -43
- data/platform/symbian/rhodes/src/rhodesAppUi.cpp +0 -436
- data/platform/symbian/rhodes/src/rhodesAppView.cpp +0 -851
- data/platform/symbian/rhodes/src/rhodesApplication.cpp +0 -51
- data/platform/symbian/rhodes/src/rhodesDocument.cpp +0 -97
- data/platform/symbian/rhodes/src/rsyncengine.c +0 -11
- data/platform/symbian/rhodes/src/webview/webview.cpp +0 -44
- data/platform/symbian/rubylib/group/bld.inf +0 -7
- data/platform/symbian/rubylib/group/rubylib.mmp +0 -143
- data/platform/symbian/shttpd/group/bld.inf +0 -5
- data/platform/symbian/shttpd/group/shttpd.mmp +0 -24
- data/platform/symbian/tcmalloc/group/bld.inf +0 -15
- data/platform/symbian/tcmalloc/group/tcmalloc.mmp +0 -31
- data/platform/wm/rhodes/emulator/ExternalWebView.cpp +0 -20
- data/platform/wm/rhodes/emulator/ExternalWebView.h +0 -23
- data/platform/wm/rhodes/emulator/MainWindowCallback.h +0 -19
- data/platform/wm/rhodes/emulator/MainWindowProxy.cpp +0 -270
- data/platform/wm/rhodes/emulator/MainWindowProxy.h +0 -34
- data/platform/wm/rhodes/emulator/MainWindowQt.cpp +0 -356
- data/platform/wm/rhodes/emulator/NativeToolbarQt.cpp +0 -57
- data/platform/wm/rhodes/emulator/NativeToolbarQt.h +0 -52
- data/platform/wm/rhodes/emulator/QtMainWindow.cpp +0 -252
- data/platform/wm/rhodes/emulator/QtMainWindow.h +0 -62
- data/platform/wm/rhodes/rho/rubyext/NativeToolbarExt.h +0 -6
- data/platform/wp7/WPApplication.sln +0 -50
- data/platform/wp7/WPApplication/App.xaml +0 -19
- data/platform/wp7/WPApplication/App.xaml.cs +0 -211
- data/platform/wp7/WPApplication/ApplicationIcon.png +0 -0
- data/platform/wp7/WPApplication/Background.png +0 -0
- data/platform/wp7/WPApplication/MainPage.xaml +0 -44
- data/platform/wp7/WPApplication/MainPage.xaml.cs +0 -132
- data/platform/wp7/WPApplication/Properties/AppManifest.xml +0 -6
- data/platform/wp7/WPApplication/Properties/AssemblyInfo.cs +0 -35
- data/platform/wp7/WPApplication/Properties/WMAppManifest.xml +0 -32
- data/platform/wp7/WPApplication/SplashScreenImage.jpg +0 -0
- data/platform/wp7/WPApplication/WPApplication.csproj +0 -201
- data/platform/wp7/WPApplication/WP_PlatformAdaptationLayer.cs +0 -88
- data/platform/wp7/WPApplication/app_manifest.txt +0 -1
- data/platform/wp7/WPApplication/readme.htm +0 -40
- data/platform/wp7/WPApplication/readme2.htm +0 -37
- data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.bb.erb +0 -29
- data/platform/wp7/WPApplication/rho/apps/app/Model1/edit.erb +0 -32
- data/platform/wp7/WPApplication/rho/apps/app/Model1/index.bb.erb +0 -21
- data/platform/wp7/WPApplication/rho/apps/app/Model1/index.erb +0 -26
- data/platform/wp7/WPApplication/rho/apps/app/Model1/model1.rb +0 -10
- data/platform/wp7/WPApplication/rho/apps/app/Model1/model1_controller.rb +0 -58
- data/platform/wp7/WPApplication/rho/apps/app/Model1/new.bb.erb +0 -29
- data/platform/wp7/WPApplication/rho/apps/app/Model1/new.erb +0 -31
- data/platform/wp7/WPApplication/rho/apps/app/Model1/show.bb.erb +0 -26
- data/platform/wp7/WPApplication/rho/apps/app/Model1/show.erb +0 -28
- data/platform/wp7/WPApplication/rho/apps/app/Settings/controller.rb +0 -75
- data/platform/wp7/WPApplication/rho/apps/app/Settings/home.bb.erb +0 -17
- data/platform/wp7/WPApplication/rho/apps/app/Settings/home.erb +0 -20
- data/platform/wp7/WPApplication/rho/apps/app/Settings/index.bb.erb +0 -32
- data/platform/wp7/WPApplication/rho/apps/app/Settings/index.erb +0 -30
- data/platform/wp7/WPApplication/rho/apps/app/Settings/login.bb.erb +0 -35
- data/platform/wp7/WPApplication/rho/apps/app/Settings/login.erb +0 -27
- data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.bb.erb +0 -15
- data/platform/wp7/WPApplication/rho/apps/app/Settings/reset.erb +0 -17
- data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.bb.erb +0 -3
- data/platform/wp7/WPApplication/rho/apps/app/Settings/wait.erb +0 -5
- data/platform/wp7/WPApplication/rho/apps/app/application.rb +0 -16
- data/platform/wp7/WPApplication/rho/apps/app/helpers/application_helper.rb +0 -126
- data/platform/wp7/WPApplication/rho/apps/app/helpers/browser_helper.rb +0 -18
- data/platform/wp7/WPApplication/rho/apps/app/index.bb.erb +0 -26
- data/platform/wp7/WPApplication/rho/apps/app/index.erb +0 -26
- data/platform/wp7/WPApplication/rho/apps/app/layout.erb +0 -47
- data/platform/wp7/WPApplication/rho/apps/app/loading.html +0 -11
- data/platform/wp7/WPApplication/rho/apps/app_manifest.txt +0 -1
- data/platform/wp7/WPApplication/rho/apps/public/css/android.css +0 -330
- data/platform/wp7/WPApplication/rho/apps/public/css/blackberry.css +0 -115
- data/platform/wp7/WPApplication/rho/apps/public/css/iphone.css +0 -410
- data/platform/wp7/WPApplication/rho/apps/public/css/windows_mobile.css +0 -222
- data/platform/wp7/WPApplication/rho/apps/public/images/IUI_LICENSE.txt +0 -21
- data/platform/wp7/WPApplication/rho/apps/public/images/android/ic_menu_more.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/backButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/blueButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/cancel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/grayButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/disclosure_detail.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/backButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/blueButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/cancel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/chevron.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/grayButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listArrowSel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/listGroup.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/loading.gif +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/on_off.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/pinstripes.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/selection.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/thumb.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggle.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toggleOn.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/toolbar.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/jqtouch/whiteButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/radiobutton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/select.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iphone/switch.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/iui-logo-touch-icon.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrow.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrowDown.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listArrowSel.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/listGroup.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/loading.gif +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/pinstripes.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/right_button.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/selection.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/thumb.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toggle.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toggleOn.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolButton_new.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/toolbar.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/images/whiteButton.png +0 -0
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch-iphone.css +0 -9
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.css +0 -374
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.js +0 -742
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jqtouch.transitions.js +0 -60
- data/platform/wp7/WPApplication/rho/apps/public/jqtouch/jquery.1.3.2.min.js +0 -19
- data/platform/wp7/WPApplication/rho/apps/public/js/application.js +0 -1
- data/platform/wp7/WPApplication/rho/apps/public/js/rho.js +0 -4
- data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation-wm.js +0 -59
- data/platform/wp7/WPApplication/rho/apps/public/js/rhogeolocation.js +0 -11
- data/platform/wp7/WPApplication/rho/apps/rhoconfig.txt +0 -32
- data/platform/wp7/WPApplication/rhoconfig.txt +0 -32
- data/platform/wp7/WPApplication/windows_mobile.css +0 -222
- data/res/generators/templates/application/public/jqtouch/changes.txt +0 -20
- data/res/generators/templates/application/public/jqtouch/jqtouch.css +0 -374
- data/res/generators/templates/application/public/jqtouch/jqtouch.js +0 -771
- data/res/generators/templates/application/public/jqtouch/jqtouch.transitions.js +0 -60
- data/res/generators/templates/application/public/jqtouch/jquery.1.3.2.min.js +0 -19
- data/res/generators/templates/application/public/js/wp7.js +0 -7
@@ -0,0 +1,107 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
**
|
3
|
+
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
** All rights reserved.
|
5
|
+
** Contact: Nokia Corporation (qt-info@nokia.com)
|
6
|
+
**
|
7
|
+
** This file is part of the QtGui module of the Qt Toolkit.
|
8
|
+
**
|
9
|
+
** $QT_BEGIN_LICENSE:LGPL$
|
10
|
+
** No Commercial Usage
|
11
|
+
** This file contains pre-release code and may not be distributed.
|
12
|
+
** You may use this file in accordance with the terms and conditions
|
13
|
+
** contained in the Technology Preview License Agreement accompanying
|
14
|
+
** this package.
|
15
|
+
**
|
16
|
+
** GNU Lesser General Public License Usage
|
17
|
+
** Alternatively, this file may be used under the terms of the GNU Lesser
|
18
|
+
** General Public License version 2.1 as published by the Free Software
|
19
|
+
** Foundation and appearing in the file LICENSE.LGPL included in the
|
20
|
+
** packaging of this file. Please review the following information to
|
21
|
+
** ensure the GNU Lesser General Public License version 2.1 requirements
|
22
|
+
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
23
|
+
**
|
24
|
+
** In addition, as a special exception, Nokia gives you certain additional
|
25
|
+
** rights. These rights are described in the Nokia Qt LGPL Exception
|
26
|
+
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
27
|
+
**
|
28
|
+
** If you have questions regarding the use of this file, please contact
|
29
|
+
** Nokia at qt-info@nokia.com.
|
30
|
+
**
|
31
|
+
**
|
32
|
+
**
|
33
|
+
**
|
34
|
+
**
|
35
|
+
**
|
36
|
+
**
|
37
|
+
**
|
38
|
+
** $QT_END_LICENSE$
|
39
|
+
**
|
40
|
+
****************************************************************************/
|
41
|
+
|
42
|
+
#ifndef QTFLICKGESTURE_P_H
|
43
|
+
#define QTFLICKGESTURE_P_H
|
44
|
+
|
45
|
+
//
|
46
|
+
// W A R N I N G
|
47
|
+
// -------------
|
48
|
+
//
|
49
|
+
// This file is not part of the Qt API. It exists for the convenience
|
50
|
+
// of other Qt classes. This header file may change from version to
|
51
|
+
// version without notice, or even be removed.
|
52
|
+
//
|
53
|
+
// We mean it.
|
54
|
+
//
|
55
|
+
|
56
|
+
#include "qobject.h"
|
57
|
+
#include "qpointer.h"
|
58
|
+
#include "qevent.h"
|
59
|
+
#include "qgesture.h"
|
60
|
+
#include "qgesturerecognizer.h"
|
61
|
+
#include "qtscroller.h"
|
62
|
+
|
63
|
+
#ifndef QT_NO_GESTURES
|
64
|
+
|
65
|
+
class PressDelayHandler;
|
66
|
+
|
67
|
+
class QtFlickGesture : public QGesture
|
68
|
+
{
|
69
|
+
Q_OBJECT
|
70
|
+
|
71
|
+
public:
|
72
|
+
QtFlickGesture(QObject *receiver, Qt::MouseButton button, QObject *parent = 0);
|
73
|
+
~QtFlickGesture();
|
74
|
+
|
75
|
+
protected:
|
76
|
+
bool eventFilter(QObject *o, QEvent *e);
|
77
|
+
|
78
|
+
private:
|
79
|
+
QPointer<QObject> receiver;
|
80
|
+
QtScroller *receiverScroller;
|
81
|
+
Qt::MouseButton button; // NoButton == Touch
|
82
|
+
bool macIgnoreWheel;
|
83
|
+
// QWidget::mapFromGlobal is very expensive on X11, so we cache the global position of the widget
|
84
|
+
QPointer<QWidget> receiverWindow;
|
85
|
+
QPoint receiverWindowPos;
|
86
|
+
|
87
|
+
static PressDelayHandler *pressDelayHandler;
|
88
|
+
|
89
|
+
friend class QtFlickGestureRecognizer;
|
90
|
+
};
|
91
|
+
|
92
|
+
class QtFlickGestureRecognizer : public QGestureRecognizer
|
93
|
+
{
|
94
|
+
public:
|
95
|
+
QtFlickGestureRecognizer(Qt::MouseButton button);
|
96
|
+
|
97
|
+
QGesture *create(QObject *target);
|
98
|
+
QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event);
|
99
|
+
void reset(QGesture *state);
|
100
|
+
|
101
|
+
private:
|
102
|
+
Qt::MouseButton button; // NoButton == Touch
|
103
|
+
};
|
104
|
+
|
105
|
+
#endif // QT_NO_GESTURES
|
106
|
+
|
107
|
+
#endif // QTFLICKGESTURE_P_H
|
@@ -0,0 +1,2081 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
**
|
3
|
+
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
4
|
+
** All rights reserved.
|
5
|
+
** Contact: Nokia Corporation (qt-info@nokia.com)
|
6
|
+
**
|
7
|
+
** This file is part of the QtGui module of the Qt Toolkit.
|
8
|
+
**
|
9
|
+
** $QT_BEGIN_LICENSE:LGPL$
|
10
|
+
** No Commercial Usage
|
11
|
+
** This file contains pre-release code and may not be distributed.
|
12
|
+
** You may use this file in accordance with the terms and conditions
|
13
|
+
** contained in the Technology Preview License Agreement accompanying
|
14
|
+
** this package.
|
15
|
+
**
|
16
|
+
** GNU Lesser General Public License Usage
|
17
|
+
** Alternatively, this file may be used under the terms of the GNU Lesser
|
18
|
+
** General Public License version 2.1 as published by the Free Software
|
19
|
+
** Foundation and appearing in the file LICENSE.LGPL included in the
|
20
|
+
** packaging of this file. Please review the following information to
|
21
|
+
** ensure the GNU Lesser General Public License version 2.1 requirements
|
22
|
+
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
23
|
+
**
|
24
|
+
** In addition, as a special exception, Nokia gives you certain additional
|
25
|
+
** rights. These rights are described in the Nokia Qt LGPL Exception
|
26
|
+
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
27
|
+
**
|
28
|
+
** If you have questions regarding the use of this file, please contact
|
29
|
+
** Nokia at qt-info@nokia.com.
|
30
|
+
**
|
31
|
+
**
|
32
|
+
**
|
33
|
+
**
|
34
|
+
**
|
35
|
+
**
|
36
|
+
**
|
37
|
+
**
|
38
|
+
** $QT_END_LICENSE$
|
39
|
+
**
|
40
|
+
****************************************************************************/
|
41
|
+
|
42
|
+
#include "qevent.h"
|
43
|
+
#include "qwidget.h"
|
44
|
+
#include "qtscroller.h"
|
45
|
+
#include "qtflickgesture_p.h"
|
46
|
+
#include "qtscroller_p.h"
|
47
|
+
#include "qtscrollerproperties.h"
|
48
|
+
#include "qtscrollerproperties_p.h"
|
49
|
+
|
50
|
+
#include "math.h"
|
51
|
+
|
52
|
+
#include <QTime>
|
53
|
+
#include <QMap>
|
54
|
+
#include <QApplication>
|
55
|
+
#include <QAbstractScrollArea>
|
56
|
+
#include <QGraphicsObject>
|
57
|
+
#include <QGraphicsScene>
|
58
|
+
#include <QGraphicsView>
|
59
|
+
#include <QDesktopWidget>
|
60
|
+
#include <QtCore/qmath.h>
|
61
|
+
#include <QtGui/qevent.h>
|
62
|
+
#include <qnumeric.h>
|
63
|
+
|
64
|
+
// completely optional warning, but you can go nuts if you forget to set the scroll mode right
|
65
|
+
#define ITEMVIEW_SCROLLMODE_WARNING 1
|
66
|
+
#ifdef ITEMVIEW_SCROLLMODE_WARNING
|
67
|
+
# include <QAbstractItemView>
|
68
|
+
#endif
|
69
|
+
|
70
|
+
#include <QtDebug>
|
71
|
+
|
72
|
+
// vvv QScroller Solution only
|
73
|
+
#include "qtscrollerfilter_p.h"
|
74
|
+
#include "qtscrollevent.h"
|
75
|
+
// ^^^ QScroller Solution only
|
76
|
+
|
77
|
+
#if defined(Q_WS_X11)
|
78
|
+
# include <QX11Info>
|
79
|
+
# include <QLibrary>
|
80
|
+
#endif
|
81
|
+
|
82
|
+
|
83
|
+
bool qt_sendSpontaneousEvent(QObject *receiver, QEvent *event);
|
84
|
+
|
85
|
+
//#define QSCROLLER_DEBUG
|
86
|
+
|
87
|
+
#ifdef QSCROLLER_DEBUG
|
88
|
+
# define qScrollerDebug qDebug
|
89
|
+
#else
|
90
|
+
# define qScrollerDebug while (false) qDebug
|
91
|
+
#endif
|
92
|
+
|
93
|
+
QDebug &operator<<(QDebug &dbg, const QtScrollerPrivate::ScrollSegment &s)
|
94
|
+
{
|
95
|
+
dbg << "\n Time: start:" << s.startTime << " duration:" << s.deltaTime << " stop progress:" << s.stopProgress;
|
96
|
+
dbg << "\n Pos: start:" << s.startPos << " delta:" << s.deltaPos << " stop:" << s.stopPos;
|
97
|
+
dbg << "\n Curve: type:" << s.curve.type() << "\n";
|
98
|
+
return dbg;
|
99
|
+
}
|
100
|
+
|
101
|
+
|
102
|
+
// a few helper operators to make the code below a lot more readable:
|
103
|
+
// otherwise a lot of ifs would have to be multi-line to check both the x
|
104
|
+
// and y coordinate separately.
|
105
|
+
|
106
|
+
// returns true only if the abs. value of BOTH x and y are <= f
|
107
|
+
inline bool operator<=(const QPointF &p, qreal f)
|
108
|
+
{
|
109
|
+
return (qAbs(p.x()) <= f) && (qAbs(p.y()) <= f);
|
110
|
+
}
|
111
|
+
|
112
|
+
// returns true only if the abs. value of BOTH x and y are < f
|
113
|
+
inline bool operator<(const QPointF &p, qreal f)
|
114
|
+
{
|
115
|
+
return (qAbs(p.x()) < f) && (qAbs(p.y()) < f);
|
116
|
+
}
|
117
|
+
|
118
|
+
// returns true if the abs. value of EITHER x or y are >= f
|
119
|
+
inline bool operator>=(const QPointF &p, qreal f)
|
120
|
+
{
|
121
|
+
return (qAbs(p.x()) >= f) || (qAbs(p.y()) >= f);
|
122
|
+
}
|
123
|
+
|
124
|
+
// returns true if the abs. value of EITHER x or y are > f
|
125
|
+
inline bool operator>(const QPointF &p, qreal f)
|
126
|
+
{
|
127
|
+
return (qAbs(p.x()) > f) || (qAbs(p.y()) > f);
|
128
|
+
}
|
129
|
+
|
130
|
+
// returns a new point with both coordinates having the abs. value of the original one
|
131
|
+
inline QPointF qAbs(const QPointF &p)
|
132
|
+
{
|
133
|
+
return QPointF(qAbs(p.x()), qAbs(p.y()));
|
134
|
+
}
|
135
|
+
|
136
|
+
// returns a new point with all components of p1 multiplied by the corresponding components of p2
|
137
|
+
inline QPointF operator*(const QPointF &p1, const QPointF &p2)
|
138
|
+
{
|
139
|
+
return QPointF(p1.x() * p2.x(), p1.y() * p2.y());
|
140
|
+
}
|
141
|
+
|
142
|
+
// returns a new point with all components of p1 divided by the corresponding components of p2
|
143
|
+
inline QPointF operator/(const QPointF &p1, const QPointF &p2)
|
144
|
+
{
|
145
|
+
return QPointF(p1.x() / p2.x(), p1.y() / p2.y());
|
146
|
+
}
|
147
|
+
|
148
|
+
inline QPointF clampToRect(const QPointF &p, const QRectF &rect)
|
149
|
+
{
|
150
|
+
qreal x = qBound(rect.left(), p.x(), rect.right());
|
151
|
+
qreal y = qBound(rect.top(), p.y(), rect.bottom());
|
152
|
+
return QPointF(x, y);
|
153
|
+
}
|
154
|
+
|
155
|
+
// returns -1, 0 or +1 according to r being <0, ==0 or >0
|
156
|
+
inline int qSign(qreal r)
|
157
|
+
{
|
158
|
+
return (r < 0) ? -1 : ((r > 0) ? 1 : 0);
|
159
|
+
}
|
160
|
+
|
161
|
+
// this version is not mathematically exact, but it just works for every
|
162
|
+
// easing curve type (even custom ones)
|
163
|
+
|
164
|
+
static qreal differentialForProgress(const QEasingCurve &curve, qreal pos)
|
165
|
+
{
|
166
|
+
const qreal dx = 0.01;
|
167
|
+
qreal left = (pos < qreal(0.5)) ? pos : pos - qreal(dx);
|
168
|
+
qreal right = (pos >= qreal(0.5)) ? pos : pos + qreal(dx);
|
169
|
+
qreal d = (curve.valueForProgress(right) - curve.valueForProgress(left)) / qreal(dx);
|
170
|
+
|
171
|
+
//qScrollerDebug() << "differentialForProgress(type: " << curve.type() << ", pos: " << pos << ") = " << d;
|
172
|
+
|
173
|
+
return d;
|
174
|
+
}
|
175
|
+
|
176
|
+
// this version is not mathematically exact, but it just works for every
|
177
|
+
// easing curve type (even custom ones)
|
178
|
+
|
179
|
+
static qreal progressForValue(const QEasingCurve &curve, qreal value)
|
180
|
+
{
|
181
|
+
if (curve.type() >= QEasingCurve::InElastic &&
|
182
|
+
curve.type() < QEasingCurve::Custom) {
|
183
|
+
qWarning("progressForValue(): QEasingCurves of type %d do not have an inverse, since they are not injective.", curve.type());
|
184
|
+
return value;
|
185
|
+
}
|
186
|
+
if (value < qreal(0) || value > qreal(1))
|
187
|
+
return value;
|
188
|
+
|
189
|
+
qreal progress = value, left(0), right(1);
|
190
|
+
for (int iterations = 6; iterations; --iterations) {
|
191
|
+
qreal v = curve.valueForProgress(progress);
|
192
|
+
if (v < value)
|
193
|
+
left = progress;
|
194
|
+
else if (v > value)
|
195
|
+
right = progress;
|
196
|
+
else
|
197
|
+
break;
|
198
|
+
progress = (left + right) / qreal(2);
|
199
|
+
}
|
200
|
+
return progress;
|
201
|
+
}
|
202
|
+
|
203
|
+
|
204
|
+
class QScrollTimer : public QAbstractAnimation
|
205
|
+
{
|
206
|
+
public:
|
207
|
+
QScrollTimer(QtScrollerPrivate *_d)
|
208
|
+
: d(_d), ignoreUpdate(false), skip(0)
|
209
|
+
{ }
|
210
|
+
|
211
|
+
int duration() const
|
212
|
+
{
|
213
|
+
return -1;
|
214
|
+
}
|
215
|
+
|
216
|
+
void start()
|
217
|
+
{
|
218
|
+
// QAbstractAnimation::start() will immediately call
|
219
|
+
// updateCurrentTime(), but our state is not set correctly yet
|
220
|
+
ignoreUpdate = true;
|
221
|
+
QAbstractAnimation::start();
|
222
|
+
ignoreUpdate = false;
|
223
|
+
skip = 0;
|
224
|
+
}
|
225
|
+
|
226
|
+
protected:
|
227
|
+
void updateCurrentTime(int /*currentTime*/)
|
228
|
+
{
|
229
|
+
if (!ignoreUpdate) {
|
230
|
+
if (++skip >= d->frameRateSkip()) {
|
231
|
+
skip = 0;
|
232
|
+
d->timerTick();
|
233
|
+
}
|
234
|
+
}
|
235
|
+
}
|
236
|
+
|
237
|
+
private:
|
238
|
+
QtScrollerPrivate *d;
|
239
|
+
bool ignoreUpdate;
|
240
|
+
int skip;
|
241
|
+
};
|
242
|
+
|
243
|
+
/*!
|
244
|
+
\class QScroller
|
245
|
+
\brief The QScroller class enables kinetic scrolling for any scrolling widget or graphics item.
|
246
|
+
\class QtScroller
|
247
|
+
\brief The QtScroller class enables kinetic scrolling for any scrolling widget or graphics item.
|
248
|
+
\since 4.8
|
249
|
+
|
250
|
+
With kinetic scrolling, the user can push the widget in a given
|
251
|
+
direction and it will continue to scroll in this direction until it is
|
252
|
+
stopped either by the user or by friction. Aspects of inertia, friction
|
253
|
+
and other physical concepts can be changed in order to fine-tune an
|
254
|
+
intuitive user experience.
|
255
|
+
|
256
|
+
The QtScroller object is the object that stores the current position and
|
257
|
+
scrolling speed and takes care of updates.
|
258
|
+
QtScroller can be triggered by a flick gesture
|
259
|
+
|
260
|
+
\code
|
261
|
+
QWidget *w = ...;
|
262
|
+
QtScroller::grabGesture(w, QtScroller::LeftMouseButtonGesture);
|
263
|
+
\endcode
|
264
|
+
|
265
|
+
or directly like this:
|
266
|
+
|
267
|
+
\code
|
268
|
+
QWidget *w = ...;
|
269
|
+
QtScroller *scroller = QtScroller::scroller(w);
|
270
|
+
scroller->scrollTo(QPointF(100, 100));
|
271
|
+
\endcode
|
272
|
+
|
273
|
+
The scrolled QObjects receive a QScrollPrepareEvent whenever the scroller needs to
|
274
|
+
update its geometry information and a QScrollEvent whenever the content of the object should
|
275
|
+
actually be scrolled.
|
276
|
+
|
277
|
+
The scroller uses the global QAbstractAnimation timer to generate its QScrollEvents. This
|
278
|
+
can be changed with QtScrollerProperties::FrameRate on a per-QtScroller basis.
|
279
|
+
|
280
|
+
Several examples in the \c scroller examples directory show how QtScroller,
|
281
|
+
QScrollEvent and the scroller gesture can be used.
|
282
|
+
|
283
|
+
Even though this kinetic scroller has a large number of settings available via
|
284
|
+
QtScrollerProperties, we recommend that you leave them all at their default, platform optimized
|
285
|
+
values. Before changing them you can experiment with the \c plot example in
|
286
|
+
the \c scroller examples directory.
|
287
|
+
|
288
|
+
\sa QtScrollEvent, QtScrollPrepareEvent, QtScrollerProperties
|
289
|
+
*/
|
290
|
+
|
291
|
+
|
292
|
+
QMap<QObject *, QtScroller *> QtScrollerPrivate::allScrollers;
|
293
|
+
QSet<QtScroller *> QtScrollerPrivate::activeScrollers;
|
294
|
+
|
295
|
+
/*!
|
296
|
+
Returns \c true if a QtScroller object was already created for \a target; \c false otherwise.
|
297
|
+
|
298
|
+
\sa scroller()
|
299
|
+
*/
|
300
|
+
bool QtScroller::hasScroller(QObject *target)
|
301
|
+
{
|
302
|
+
return (QtScrollerPrivate::allScrollers.value(target));
|
303
|
+
}
|
304
|
+
|
305
|
+
/*!
|
306
|
+
Returns the scroller for the given \a target.
|
307
|
+
As long as the object exists this function will always return the same QtScroller instance.
|
308
|
+
If no QtScroller exists for the \a target, one will implicitly be created.
|
309
|
+
At no point more than one QtScroller will be active on an object.
|
310
|
+
|
311
|
+
\sa hasScroller(), target()
|
312
|
+
*/
|
313
|
+
QtScroller *QtScroller::scroller(QObject *target)
|
314
|
+
{
|
315
|
+
if (!target) {
|
316
|
+
qWarning("QtScroller::scroller() was called with a null target.");
|
317
|
+
return 0;
|
318
|
+
}
|
319
|
+
|
320
|
+
if (QtScrollerPrivate::allScrollers.contains(target))
|
321
|
+
return QtScrollerPrivate::allScrollers.value(target);
|
322
|
+
|
323
|
+
QtScroller *s = new QtScroller(target);
|
324
|
+
QtScrollerPrivate::allScrollers.insert(target, s);
|
325
|
+
return s;
|
326
|
+
}
|
327
|
+
|
328
|
+
/*!
|
329
|
+
\overload
|
330
|
+
This is the const version of scroller().
|
331
|
+
*/
|
332
|
+
const QtScroller *QtScroller::scroller(const QObject *target)
|
333
|
+
{
|
334
|
+
return scroller(const_cast<QObject*>(target));
|
335
|
+
}
|
336
|
+
|
337
|
+
/*!
|
338
|
+
Returns an application wide list of currently active QtScroller objects.
|
339
|
+
Active QtScroller objects are in a state() that is not QtScroller::Inactive.
|
340
|
+
This function is useful when writing your own gesture recognizer.
|
341
|
+
*/
|
342
|
+
QList<QtScroller *> QtScroller::activeScrollers()
|
343
|
+
{
|
344
|
+
return QtScrollerPrivate::activeScrollers.toList();
|
345
|
+
}
|
346
|
+
|
347
|
+
/*!
|
348
|
+
Returns the target object of this scroller.
|
349
|
+
\sa hasScroller(), scroller()
|
350
|
+
*/
|
351
|
+
QObject *QtScroller::target() const
|
352
|
+
{
|
353
|
+
Q_D(const QtScroller);
|
354
|
+
return d->target;
|
355
|
+
}
|
356
|
+
|
357
|
+
/*!
|
358
|
+
\fn QtScroller::scrollerPropertiesChanged(const QtScrollerProperties &newProperties);
|
359
|
+
|
360
|
+
QtScroller emits this signal whenever its scroller properties change.
|
361
|
+
\a newProperties are the new scroller properties.
|
362
|
+
|
363
|
+
\sa scrollerProperties
|
364
|
+
*/
|
365
|
+
|
366
|
+
|
367
|
+
/*! \property QtScroller::scrollerProperties
|
368
|
+
\brief The scroller properties of this scroller.
|
369
|
+
The properties are used by the QtScroller to determine its scrolling behavior.
|
370
|
+
*/
|
371
|
+
QtScrollerProperties QtScroller::scrollerProperties() const
|
372
|
+
{
|
373
|
+
Q_D(const QtScroller);
|
374
|
+
return d->properties;
|
375
|
+
}
|
376
|
+
|
377
|
+
void QtScroller::setScrollerProperties(const QtScrollerProperties &sp)
|
378
|
+
{
|
379
|
+
Q_D(QtScroller);
|
380
|
+
if (d->properties != sp) {
|
381
|
+
d->properties = sp;
|
382
|
+
emit scrollerPropertiesChanged(sp);
|
383
|
+
|
384
|
+
// we need to force the recalculation here, since the overshootPolicy may have changed and
|
385
|
+
// existing segments may include an overshoot animation.
|
386
|
+
d->recalcScrollingSegments(true);
|
387
|
+
}
|
388
|
+
}
|
389
|
+
|
390
|
+
|
391
|
+
/*!
|
392
|
+
Registers a custom scroll gesture recognizer, grabs it for the \a
|
393
|
+
target and returns the resulting gesture type. If \a scrollGestureType is
|
394
|
+
set to TouchGesture the gesture triggers on touch events. If it is set to
|
395
|
+
one of LeftMouseButtonGesture, RightMouseButtonGesture or
|
396
|
+
MiddleMouseButtonGesture it triggers on mouse events of the
|
397
|
+
corresponding button.
|
398
|
+
|
399
|
+
Only one scroll gesture can be active on a single object at the same
|
400
|
+
time. If you call this function twice on the same object, it will
|
401
|
+
ungrab the existing gesture before grabbing the new one.
|
402
|
+
|
403
|
+
\note To avoid unwanted side-effects, mouse events are consumed while
|
404
|
+
the gesture is triggered. Since the initial mouse press event is
|
405
|
+
not consumed, the gesture sends a fake mouse release event
|
406
|
+
at the global position \c{(INT_MIN, INT_MIN)}. This ensures that
|
407
|
+
internal states of the widget that received the original mouse press
|
408
|
+
are consistent.
|
409
|
+
|
410
|
+
\sa ungrabGesture, grabbedGesture
|
411
|
+
*/
|
412
|
+
Qt::GestureType QtScroller::grabGesture(QObject *target, ScrollerGestureType scrollGestureType)
|
413
|
+
{
|
414
|
+
// ensure that a scroller for target is created
|
415
|
+
QtScroller *s = scroller(target);
|
416
|
+
if (!s)
|
417
|
+
return Qt::GestureType(0);
|
418
|
+
|
419
|
+
QtScrollerPrivate *sp = s->d_ptr;
|
420
|
+
if (sp->recognizer)
|
421
|
+
ungrabGesture(target); // ungrab the old gesture
|
422
|
+
|
423
|
+
Qt::MouseButton button;
|
424
|
+
switch (scrollGestureType) {
|
425
|
+
case LeftMouseButtonGesture : button = Qt::LeftButton; break;
|
426
|
+
case RightMouseButtonGesture : button = Qt::RightButton; break;
|
427
|
+
case MiddleMouseButtonGesture: button = Qt::MidButton; break;
|
428
|
+
default :
|
429
|
+
case TouchGesture : button = Qt::NoButton; break; // NoButton == Touch
|
430
|
+
}
|
431
|
+
|
432
|
+
sp->recognizer = new QtFlickGestureRecognizer(button);
|
433
|
+
sp->recognizerType = QGestureRecognizer::registerRecognizer(sp->recognizer);
|
434
|
+
if (target->isWidgetType()) {
|
435
|
+
QWidget *widget = static_cast<QWidget *>(target);
|
436
|
+
widget->grabGesture(sp->recognizerType);
|
437
|
+
if (scrollGestureType == TouchGesture)
|
438
|
+
widget->setAttribute(Qt::WA_AcceptTouchEvents);
|
439
|
+
#if ITEMVIEW_SCROLLMODE_WARNING
|
440
|
+
QAbstractItemView *view = 0;
|
441
|
+
if ((view = qobject_cast<QAbstractItemView *>(widget->parentWidget())) &&
|
442
|
+
(view->viewport() == widget)) {
|
443
|
+
if (view->verticalScrollMode() != QAbstractItemView::ScrollPerPixel)
|
444
|
+
qWarning("QtScroller::grabGesture() was called on a QAbstractItemView with verticaScrollMode not set to ScrollPerPixel");
|
445
|
+
if (view->horizontalScrollMode() != QAbstractItemView::ScrollPerPixel)
|
446
|
+
qWarning("QtScroller::grabGesture() was called on a QAbstractItemView with horizontalScrollMode not set to ScrollPerPixel");
|
447
|
+
}
|
448
|
+
#endif // ITEMVIEW_SCROLLMODE_WARNING
|
449
|
+
} else if (QGraphicsObject *go = qobject_cast<QGraphicsObject*>(target)) {
|
450
|
+
if (scrollGestureType == TouchGesture)
|
451
|
+
go->setAcceptTouchEvents(true);
|
452
|
+
go->grabGesture(sp->recognizerType);
|
453
|
+
}
|
454
|
+
|
455
|
+
// vvv QScroller Solution only
|
456
|
+
QtScrollerFilter::instance()->add(target);
|
457
|
+
// ^^^ QScroller Solution only
|
458
|
+
|
459
|
+
return sp->recognizerType;
|
460
|
+
}
|
461
|
+
|
462
|
+
/*!
|
463
|
+
Returns the gesture type currently grabbed for the \a target or 0 if no
|
464
|
+
gesture is grabbed.
|
465
|
+
|
466
|
+
\sa grabGesture, ungrabGesture
|
467
|
+
*/
|
468
|
+
Qt::GestureType QtScroller::grabbedGesture(QObject *target)
|
469
|
+
{
|
470
|
+
QtScroller *s = scroller(target);
|
471
|
+
if (s && s->d_ptr)
|
472
|
+
return s->d_ptr->recognizerType;
|
473
|
+
else
|
474
|
+
return Qt::GestureType(0);
|
475
|
+
}
|
476
|
+
|
477
|
+
/*!
|
478
|
+
Ungrabs the gesture for the \a target.
|
479
|
+
Does nothing if no gesture is grabbed.
|
480
|
+
|
481
|
+
\sa grabGesture, grabbedGesture
|
482
|
+
*/
|
483
|
+
void QtScroller::ungrabGesture(QObject *target)
|
484
|
+
{
|
485
|
+
QtScroller *s = scroller(target);
|
486
|
+
if (!s)
|
487
|
+
return;
|
488
|
+
|
489
|
+
QtScrollerPrivate *sp = s->d_ptr;
|
490
|
+
if (!sp->recognizer)
|
491
|
+
return; // nothing to do
|
492
|
+
|
493
|
+
if (target->isWidgetType()) {
|
494
|
+
QWidget *widget = static_cast<QWidget *>(target);
|
495
|
+
widget->ungrabGesture(sp->recognizerType);
|
496
|
+
|
497
|
+
} else if (QGraphicsObject *go = qobject_cast<QGraphicsObject*>(target)) {
|
498
|
+
go->ungrabGesture(sp->recognizerType);
|
499
|
+
}
|
500
|
+
|
501
|
+
QGestureRecognizer::unregisterRecognizer(sp->recognizerType);
|
502
|
+
// do not delete the recognizer. The QGestureManager is doing this.
|
503
|
+
sp->recognizer = 0;
|
504
|
+
|
505
|
+
// vvv QScroller Solution only
|
506
|
+
QtScrollerFilter::instance()->remove(target);
|
507
|
+
// ^^^ QScroller Solution only
|
508
|
+
}
|
509
|
+
|
510
|
+
/*!
|
511
|
+
\internal
|
512
|
+
*/
|
513
|
+
QtScroller::QtScroller(QObject *target)
|
514
|
+
: d_ptr(new QtScrollerPrivate(this, target))
|
515
|
+
{
|
516
|
+
Q_ASSERT(target); // you can't create a scroller without a target in any normal way
|
517
|
+
Q_D(QtScroller);
|
518
|
+
d->init();
|
519
|
+
}
|
520
|
+
|
521
|
+
/*!
|
522
|
+
\internal
|
523
|
+
*/
|
524
|
+
QtScroller::~QtScroller()
|
525
|
+
{
|
526
|
+
Q_D(QtScroller);
|
527
|
+
QGestureRecognizer::unregisterRecognizer(d->recognizerType);
|
528
|
+
// do not delete the recognizer. The QGestureManager is doing this.
|
529
|
+
d->recognizer = 0;
|
530
|
+
QtScrollerPrivate::allScrollers.remove(d->target);
|
531
|
+
QtScrollerPrivate::activeScrollers.remove(this);
|
532
|
+
|
533
|
+
delete d_ptr;
|
534
|
+
}
|
535
|
+
|
536
|
+
|
537
|
+
/*!
|
538
|
+
\fn QtScroller::stateChanged(QtScroller::State newState);
|
539
|
+
|
540
|
+
QtScroller emits this signal whenever the state changes. \a newState is the new State.
|
541
|
+
|
542
|
+
\sa state
|
543
|
+
*/
|
544
|
+
|
545
|
+
/*!
|
546
|
+
\property QtScroller::state
|
547
|
+
\brief the state of the scroller
|
548
|
+
|
549
|
+
\sa QtScroller::State
|
550
|
+
*/
|
551
|
+
QtScroller::State QtScroller::state() const
|
552
|
+
{
|
553
|
+
Q_D(const QtScroller);
|
554
|
+
return d->state;
|
555
|
+
}
|
556
|
+
|
557
|
+
/*!
|
558
|
+
Stops the scroller and resets its state back to Inactive.
|
559
|
+
*/
|
560
|
+
void QtScroller::stop()
|
561
|
+
{
|
562
|
+
Q_D(QtScroller);
|
563
|
+
if (d->state != Inactive) {
|
564
|
+
QPointF here = clampToRect(d->contentPosition, d->contentPosRange);
|
565
|
+
qreal snapX = d->nextSnapPos(here.x(), 0, Qt::Horizontal);
|
566
|
+
qreal snapY = d->nextSnapPos(here.y(), 0, Qt::Vertical);
|
567
|
+
QPointF snap = here;
|
568
|
+
if (!qIsNaN(snapX))
|
569
|
+
snap.setX(snapX);
|
570
|
+
if (!qIsNaN(snapY))
|
571
|
+
snap.setY(snapY);
|
572
|
+
d->contentPosition = snap;
|
573
|
+
d->overshootPosition = QPointF(0, 0);
|
574
|
+
|
575
|
+
d->setState(Inactive);
|
576
|
+
}
|
577
|
+
}
|
578
|
+
|
579
|
+
/*!
|
580
|
+
Returns the pixel per meter metric for the scrolled widget.
|
581
|
+
|
582
|
+
The value is reported for both the x and y axis separately by using a QPointF.
|
583
|
+
|
584
|
+
\note Please note that this value should be physically correct. The actual DPI settings
|
585
|
+
that Qt returns for the display may be reported wrongly on purpose by the underlying
|
586
|
+
windowing system, for example on Mac OS X or Maemo 5.
|
587
|
+
*/
|
588
|
+
QPointF QtScroller::pixelPerMeter() const
|
589
|
+
{
|
590
|
+
Q_D(const QtScroller);
|
591
|
+
QPointF ppm = d->pixelPerMeter;
|
592
|
+
|
593
|
+
if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(d->target)) {
|
594
|
+
QTransform viewtr;
|
595
|
+
//TODO: the first view isn't really correct - maybe use an additional field in the prepare event?
|
596
|
+
if (go->scene() && !go->scene()->views().isEmpty())
|
597
|
+
viewtr = go->scene()->views().first()->viewportTransform();
|
598
|
+
QTransform tr = go->deviceTransform(viewtr);
|
599
|
+
if (tr.isScaling()) {
|
600
|
+
QPointF p0 = tr.map(QPointF(0, 0));
|
601
|
+
QPointF px = tr.map(QPointF(1, 0));
|
602
|
+
QPointF py = tr.map(QPointF(0, 1));
|
603
|
+
ppm.rx() /= QLineF(p0, px).length();
|
604
|
+
ppm.ry() /= QLineF(p0, py).length();
|
605
|
+
}
|
606
|
+
}
|
607
|
+
return ppm;
|
608
|
+
}
|
609
|
+
|
610
|
+
/*!
|
611
|
+
Returns the current scrolling velocity in meter per second when the state is Scrolling or Dragging.
|
612
|
+
Returns a zero velocity otherwise.
|
613
|
+
|
614
|
+
The velocity is reported for both the x and y axis separately by using a QPointF.
|
615
|
+
|
616
|
+
\sa pixelPerMeter()
|
617
|
+
*/
|
618
|
+
QPointF QtScroller::velocity() const
|
619
|
+
{
|
620
|
+
Q_D(const QtScroller);
|
621
|
+
const QtScrollerPropertiesPrivate *sp = d->properties.d.data();
|
622
|
+
|
623
|
+
switch (state()) {
|
624
|
+
case Dragging:
|
625
|
+
return d->releaseVelocity;
|
626
|
+
case Scrolling: {
|
627
|
+
QPointF vel;
|
628
|
+
qint64 now = d->monotonicTimer.elapsed();
|
629
|
+
|
630
|
+
if (!d->xSegments.isEmpty()) {
|
631
|
+
const QtScrollerPrivate::ScrollSegment &s = d->xSegments.head();
|
632
|
+
qreal progress = qreal(now - s.startTime) / qreal(s.deltaTime);
|
633
|
+
qreal v = qSign(s.deltaPos) * qreal(s.deltaTime) / qreal(1000) * sp->decelerationFactor * qreal(0.5) * differentialForProgress(s.curve, progress);
|
634
|
+
vel.setX(v);
|
635
|
+
}
|
636
|
+
|
637
|
+
if (!d->ySegments.isEmpty()) {
|
638
|
+
const QtScrollerPrivate::ScrollSegment &s = d->ySegments.head();
|
639
|
+
qreal progress = qreal(now - s.startTime) / qreal(s.deltaTime);
|
640
|
+
qreal v = qSign(s.deltaPos) * qreal(s.deltaTime) / qreal(1000) * sp->decelerationFactor * qreal(0.5) * differentialForProgress(s.curve, progress);
|
641
|
+
vel.setY(v);
|
642
|
+
}
|
643
|
+
return vel;
|
644
|
+
}
|
645
|
+
default:
|
646
|
+
return QPointF(0, 0);
|
647
|
+
}
|
648
|
+
}
|
649
|
+
|
650
|
+
/*!
|
651
|
+
Returns the estimated final position for the current scroll movement.
|
652
|
+
Returns the current position if the scroller state is not Scrolling.
|
653
|
+
The result is undefined when the scroller state is Inactive.
|
654
|
+
|
655
|
+
The target position is in pixel.
|
656
|
+
|
657
|
+
\sa pixelPerMeter(), scrollTo()
|
658
|
+
*/
|
659
|
+
QPointF QtScroller::finalPosition() const
|
660
|
+
{
|
661
|
+
Q_D(const QtScroller);
|
662
|
+
return QPointF(d->scrollingSegmentsEndPos(Qt::Horizontal),
|
663
|
+
d->scrollingSegmentsEndPos(Qt::Vertical));
|
664
|
+
}
|
665
|
+
|
666
|
+
/*!
|
667
|
+
Starts scrolling the widget so that point \a pos is at the top-left position in
|
668
|
+
the viewport.
|
669
|
+
|
670
|
+
The behaviour when scrolling outside the valid scroll area is undefined.
|
671
|
+
In this case the scroller might or might not overshoot.
|
672
|
+
|
673
|
+
The scrolling speed will be calculated so that the given position will
|
674
|
+
be reached after a platform-defined time span.
|
675
|
+
|
676
|
+
\a pos is given in viewport coordinates.
|
677
|
+
|
678
|
+
\sa ensureVisible()
|
679
|
+
*/
|
680
|
+
void QtScroller::scrollTo(const QPointF &pos)
|
681
|
+
{
|
682
|
+
// we could make this adjustable via QtScrollerProperties
|
683
|
+
scrollTo(pos, 300);
|
684
|
+
}
|
685
|
+
|
686
|
+
/*! \overload
|
687
|
+
|
688
|
+
This version will reach its destination position in \a scrollTime milliseconds.
|
689
|
+
*/
|
690
|
+
void QtScroller::scrollTo(const QPointF &pos, int scrollTime)
|
691
|
+
{
|
692
|
+
Q_D(QtScroller);
|
693
|
+
|
694
|
+
if (d->state == Pressed || d->state == Dragging )
|
695
|
+
return;
|
696
|
+
|
697
|
+
// no need to resend a prepare event if we are already scrolling
|
698
|
+
if (d->state == Inactive && !d->prepareScrolling(QPointF()))
|
699
|
+
return;
|
700
|
+
|
701
|
+
QPointF newpos = clampToRect(pos, d->contentPosRange);
|
702
|
+
qreal snapX = d->nextSnapPos(newpos.x(), 0, Qt::Horizontal);
|
703
|
+
qreal snapY = d->nextSnapPos(newpos.y(), 0, Qt::Vertical);
|
704
|
+
if (!qIsNaN(snapX))
|
705
|
+
newpos.setX(snapX);
|
706
|
+
if (!qIsNaN(snapY))
|
707
|
+
newpos.setY(snapY);
|
708
|
+
|
709
|
+
qScrollerDebug() << "QtScroller::scrollTo(req:" << pos << " [pix] / snap:" << newpos << ", " << scrollTime << " [ms])";
|
710
|
+
|
711
|
+
if (newpos == d->contentPosition + d->overshootPosition)
|
712
|
+
return;
|
713
|
+
|
714
|
+
QPointF vel = velocity();
|
715
|
+
|
716
|
+
if (scrollTime < 0)
|
717
|
+
scrollTime = 0;
|
718
|
+
qreal time = qreal(scrollTime) / 1000;
|
719
|
+
|
720
|
+
d->createScrollToSegments(vel.x(), time, newpos.x(), Qt::Horizontal, QtScrollerPrivate::ScrollTypeScrollTo);
|
721
|
+
d->createScrollToSegments(vel.y(), time, newpos.y(), Qt::Vertical, QtScrollerPrivate::ScrollTypeScrollTo);
|
722
|
+
|
723
|
+
if (!scrollTime)
|
724
|
+
d->setContentPositionHelperScrolling();
|
725
|
+
d->setState(scrollTime ? Scrolling : Inactive);
|
726
|
+
}
|
727
|
+
|
728
|
+
/*!
|
729
|
+
Starts scrolling so that the rectangle \a rect is visible inside the
|
730
|
+
viewport with additional margins specified in pixels by \a xmargin and \a ymargin around
|
731
|
+
the rect.
|
732
|
+
|
733
|
+
In cases where it is not possible to fit the rect plus margins inside the viewport the contents
|
734
|
+
are scrolled so that as much as possible is visible from \a rect.
|
735
|
+
|
736
|
+
The scrolling speed is calculated so that the given position is reached after a platform-defined
|
737
|
+
time span.
|
738
|
+
|
739
|
+
This function performs the actual scrolling by calling scrollTo().
|
740
|
+
|
741
|
+
\sa scrollTo
|
742
|
+
*/
|
743
|
+
void QtScroller::ensureVisible(const QRectF &rect, qreal xmargin, qreal ymargin)
|
744
|
+
{
|
745
|
+
// we could make this adjustable via QtScrollerProperties
|
746
|
+
ensureVisible(rect, xmargin, ymargin, 1000);
|
747
|
+
}
|
748
|
+
|
749
|
+
/*! \overload
|
750
|
+
|
751
|
+
This version will reach its destination position in \a scrollTime milliseconds.
|
752
|
+
*/
|
753
|
+
void QtScroller::ensureVisible(const QRectF &rect, qreal xmargin, qreal ymargin, int scrollTime)
|
754
|
+
{
|
755
|
+
Q_D(QtScroller);
|
756
|
+
|
757
|
+
if (d->state == Pressed || d->state == Dragging)
|
758
|
+
return;
|
759
|
+
|
760
|
+
if (d->state == Inactive && !d->prepareScrolling(QPointF()))
|
761
|
+
return;
|
762
|
+
|
763
|
+
// -- calculate the current pos (or the position after the current scroll)
|
764
|
+
QPointF startPos = d->contentPosition + d->overshootPosition;
|
765
|
+
startPos = QPointF(d->scrollingSegmentsEndPos(Qt::Horizontal),
|
766
|
+
d->scrollingSegmentsEndPos(Qt::Vertical));
|
767
|
+
|
768
|
+
QRectF marginRect(rect.x() - xmargin, rect.y() - ymargin,
|
769
|
+
rect.width() + 2 * xmargin, rect.height() + 2 * ymargin);
|
770
|
+
|
771
|
+
QSizeF visible = d->viewportSize;
|
772
|
+
QRectF visibleRect(startPos, visible);
|
773
|
+
|
774
|
+
qScrollerDebug() << "QtScroller::ensureVisible(" << rect << " [pix], " << xmargin << " [pix], " << ymargin << " [pix], " << scrollTime << "[ms])";
|
775
|
+
qScrollerDebug() << " --> content position:" << d->contentPosition;
|
776
|
+
|
777
|
+
if (visibleRect.contains(marginRect))
|
778
|
+
return;
|
779
|
+
|
780
|
+
QPointF newPos = startPos;
|
781
|
+
|
782
|
+
if (visibleRect.width() < rect.width()) {
|
783
|
+
// at least try to move the rect into view
|
784
|
+
if (rect.left() > visibleRect.left())
|
785
|
+
newPos.setX(rect.left());
|
786
|
+
else if (rect.right() < visibleRect.right())
|
787
|
+
newPos.setX(rect.right() - visible.width());
|
788
|
+
|
789
|
+
} else if (visibleRect.width() < marginRect.width()) {
|
790
|
+
newPos.setX(rect.center().x() - visibleRect.width() / 2);
|
791
|
+
} else if (marginRect.left() > visibleRect.left()) {
|
792
|
+
newPos.setX(marginRect.left());
|
793
|
+
} else if (marginRect.right() < visibleRect.right()) {
|
794
|
+
newPos.setX(marginRect.right() - visible.width());
|
795
|
+
}
|
796
|
+
|
797
|
+
if (visibleRect.height() < rect.height()) {
|
798
|
+
// at least try to move the rect into view
|
799
|
+
if (rect.top() > visibleRect.top())
|
800
|
+
newPos.setX(rect.top());
|
801
|
+
else if (rect.bottom() < visibleRect.bottom())
|
802
|
+
newPos.setX(rect.bottom() - visible.height());
|
803
|
+
|
804
|
+
} else if (visibleRect.height() < marginRect.height()) {
|
805
|
+
newPos.setY(rect.center().y() - visibleRect.height() / 2);
|
806
|
+
} else if (marginRect.top() > visibleRect.top()) {
|
807
|
+
newPos.setY(marginRect.top());
|
808
|
+
} else if (marginRect.bottom() < visibleRect.bottom()) {
|
809
|
+
newPos.setY(marginRect.bottom() - visible.height());
|
810
|
+
}
|
811
|
+
|
812
|
+
// clamp to maximum content position
|
813
|
+
newPos = clampToRect(newPos, d->contentPosRange);
|
814
|
+
if (newPos == startPos)
|
815
|
+
return;
|
816
|
+
|
817
|
+
scrollTo(newPos, scrollTime);
|
818
|
+
}
|
819
|
+
|
820
|
+
/*! This function resends the QScrollPrepareEvent.
|
821
|
+
Calling resendPrepareEvent triggers a QScrollPrepareEvent from the scroller.
|
822
|
+
This allows the receiver to re-set content position and content size while
|
823
|
+
scrolling.
|
824
|
+
Calling this function while in the Inactive state is useless as the prepare event
|
825
|
+
is sent again before scrolling starts.
|
826
|
+
*/
|
827
|
+
void QtScroller::resendPrepareEvent()
|
828
|
+
{
|
829
|
+
Q_D(QtScroller);
|
830
|
+
d->prepareScrolling(d->pressPosition);
|
831
|
+
}
|
832
|
+
|
833
|
+
/*! Set the snap positions for the horizontal axis to a list of \a positions.
|
834
|
+
This overwrites all previously set snap positions and also a previously
|
835
|
+
set snapping interval.
|
836
|
+
Snapping can be deactivated by setting an empty list of positions.
|
837
|
+
*/
|
838
|
+
void QtScroller::setSnapPositionsX(const QList<qreal> &positions)
|
839
|
+
{
|
840
|
+
Q_D(QtScroller);
|
841
|
+
d->snapPositionsX = positions;
|
842
|
+
d->snapIntervalX = 0.0;
|
843
|
+
|
844
|
+
d->recalcScrollingSegments();
|
845
|
+
}
|
846
|
+
|
847
|
+
/*! Set the snap positions for the horizontal axis to regular spaced intervals.
|
848
|
+
The first snap position is at \a first. The next at \a first + \a interval.
|
849
|
+
This can be used to implement a list header.
|
850
|
+
This overwrites all previously set snap positions and also a previously
|
851
|
+
set snapping interval.
|
852
|
+
Snapping can be deactivated by setting an interval of 0.0
|
853
|
+
*/
|
854
|
+
void QtScroller::setSnapPositionsX(qreal first, qreal interval)
|
855
|
+
{
|
856
|
+
Q_D(QtScroller);
|
857
|
+
d->snapFirstX = first;
|
858
|
+
d->snapIntervalX = interval;
|
859
|
+
d->snapPositionsX.clear();
|
860
|
+
|
861
|
+
d->recalcScrollingSegments();
|
862
|
+
}
|
863
|
+
|
864
|
+
/*! Set the snap positions for the vertical axis to a list of \a positions.
|
865
|
+
This overwrites all previously set snap positions and also a previously
|
866
|
+
set snapping interval.
|
867
|
+
Snapping can be deactivated by setting an empty list of positions.
|
868
|
+
*/
|
869
|
+
void QtScroller::setSnapPositionsY(const QList<qreal> &positions)
|
870
|
+
{
|
871
|
+
Q_D(QtScroller);
|
872
|
+
d->snapPositionsY = positions;
|
873
|
+
d->snapIntervalY = 0.0;
|
874
|
+
|
875
|
+
d->recalcScrollingSegments();
|
876
|
+
}
|
877
|
+
|
878
|
+
/*! Set the snap positions for the vertical axis to regular spaced intervals.
|
879
|
+
The first snap position is at \a first. The next at \a first + \a interval.
|
880
|
+
This overwrites all previously set snap positions and also a previously
|
881
|
+
set snapping interval.
|
882
|
+
Snapping can be deactivated by setting an interval of 0.0
|
883
|
+
*/
|
884
|
+
void QtScroller::setSnapPositionsY(qreal first, qreal interval)
|
885
|
+
{
|
886
|
+
Q_D(QtScroller);
|
887
|
+
d->snapFirstY = first;
|
888
|
+
d->snapIntervalY = interval;
|
889
|
+
d->snapPositionsY.clear();
|
890
|
+
|
891
|
+
d->recalcScrollingSegments();
|
892
|
+
}
|
893
|
+
|
894
|
+
|
895
|
+
|
896
|
+
// -------------- private ------------
|
897
|
+
|
898
|
+
QtScrollerPrivate::QtScrollerPrivate(QtScroller *q, QObject *_target)
|
899
|
+
: target(_target)
|
900
|
+
, recognizer(0)
|
901
|
+
, recognizerType(Qt::CustomGesture)
|
902
|
+
, state(QtScroller::Inactive)
|
903
|
+
, firstScroll(true)
|
904
|
+
, pressTimestamp(0)
|
905
|
+
, lastTimestamp(0)
|
906
|
+
, snapFirstX(-1.0)
|
907
|
+
, snapIntervalX(0.0)
|
908
|
+
, snapFirstY(-1.0)
|
909
|
+
, snapIntervalY(0.0)
|
910
|
+
, scrollTimer(new QScrollTimer(this))
|
911
|
+
, q_ptr(q)
|
912
|
+
{
|
913
|
+
connect(target, SIGNAL(destroyed(QObject*)), this, SLOT(targetDestroyed()));
|
914
|
+
}
|
915
|
+
|
916
|
+
void QtScrollerPrivate::init()
|
917
|
+
{
|
918
|
+
setDpiFromWidget(0);
|
919
|
+
monotonicTimer.start();
|
920
|
+
}
|
921
|
+
|
922
|
+
void QtScrollerPrivate::sendEvent(QObject *o, QEvent *e)
|
923
|
+
{
|
924
|
+
qt_sendSpontaneousEvent(o, e);
|
925
|
+
}
|
926
|
+
|
927
|
+
const char *QtScrollerPrivate::stateName(QtScroller::State state)
|
928
|
+
{
|
929
|
+
switch (state) {
|
930
|
+
case QtScroller::Inactive: return "inactive";
|
931
|
+
case QtScroller::Pressed: return "pressed";
|
932
|
+
case QtScroller::Dragging: return "dragging";
|
933
|
+
case QtScroller::Scrolling: return "scrolling";
|
934
|
+
default: return "(invalid)";
|
935
|
+
}
|
936
|
+
}
|
937
|
+
|
938
|
+
const char *QtScrollerPrivate::inputName(QtScroller::Input input)
|
939
|
+
{
|
940
|
+
switch (input) {
|
941
|
+
case QtScroller::InputPress: return "press";
|
942
|
+
case QtScroller::InputMove: return "move";
|
943
|
+
case QtScroller::InputRelease: return "release";
|
944
|
+
default: return "(invalid)";
|
945
|
+
}
|
946
|
+
}
|
947
|
+
|
948
|
+
void QtScrollerPrivate::targetDestroyed()
|
949
|
+
{
|
950
|
+
scrollTimer->stop();
|
951
|
+
delete q_ptr;
|
952
|
+
}
|
953
|
+
|
954
|
+
void QtScrollerPrivate::timerTick()
|
955
|
+
{
|
956
|
+
struct timerevent {
|
957
|
+
QtScroller::State state;
|
958
|
+
typedef void (QtScrollerPrivate::*timerhandler_t)();
|
959
|
+
timerhandler_t handler;
|
960
|
+
};
|
961
|
+
|
962
|
+
timerevent timerevents[] = {
|
963
|
+
{ QtScroller::Dragging, &QtScrollerPrivate::timerEventWhileDragging },
|
964
|
+
{ QtScroller::Scrolling, &QtScrollerPrivate::timerEventWhileScrolling },
|
965
|
+
};
|
966
|
+
|
967
|
+
for (int i = 0; i < int(sizeof(timerevents) / sizeof(*timerevents)); ++i) {
|
968
|
+
timerevent *te = timerevents + i;
|
969
|
+
|
970
|
+
if (state == te->state) {
|
971
|
+
(this->*te->handler)();
|
972
|
+
return;
|
973
|
+
}
|
974
|
+
}
|
975
|
+
|
976
|
+
scrollTimer->stop();
|
977
|
+
}
|
978
|
+
|
979
|
+
/*!
|
980
|
+
This function is used by gesture recognizers to inform the scroller about a new input event.
|
981
|
+
The scroller changes its internal state() according to the input event and its attached
|
982
|
+
scroller properties. The scroller doesn't distinguish between the kind of input device the
|
983
|
+
event came from. Therefore the event needs to be split into the \a input type, a \a position and a
|
984
|
+
milli-second \a timestamp. The \a position needs to be in the target's coordinate system.
|
985
|
+
|
986
|
+
The return value is \c true if the event should be consumed by the calling filter or \c false
|
987
|
+
if the event should be forwarded to the control.
|
988
|
+
|
989
|
+
\note Using grabGesture() should be sufficient for most use cases.
|
990
|
+
*/
|
991
|
+
bool QtScroller::handleInput(Input input, const QPointF &position, qint64 timestamp)
|
992
|
+
{
|
993
|
+
Q_D(QtScroller);
|
994
|
+
|
995
|
+
qScrollerDebug() << "QtScroller::handleInput(" << input << ", " << d->stateName(d->state) << ", " << position << ", " << timestamp << ")";
|
996
|
+
struct statechange {
|
997
|
+
State state;
|
998
|
+
Input input;
|
999
|
+
typedef bool (QtScrollerPrivate::*inputhandler_t)(const QPointF &position, qint64 timestamp);
|
1000
|
+
inputhandler_t handler;
|
1001
|
+
};
|
1002
|
+
|
1003
|
+
statechange statechanges[] = {
|
1004
|
+
{ QtScroller::Inactive, InputPress, &QtScrollerPrivate::pressWhileInactive },
|
1005
|
+
{ QtScroller::Pressed, InputMove, &QtScrollerPrivate::moveWhilePressed },
|
1006
|
+
{ QtScroller::Pressed, InputRelease, &QtScrollerPrivate::releaseWhilePressed },
|
1007
|
+
{ QtScroller::Dragging, InputMove, &QtScrollerPrivate::moveWhileDragging },
|
1008
|
+
{ QtScroller::Dragging, InputRelease, &QtScrollerPrivate::releaseWhileDragging },
|
1009
|
+
{ QtScroller::Scrolling, InputPress, &QtScrollerPrivate::pressWhileScrolling }
|
1010
|
+
};
|
1011
|
+
|
1012
|
+
for (int i = 0; i < int(sizeof(statechanges) / sizeof(*statechanges)); ++i) {
|
1013
|
+
statechange *sc = statechanges + i;
|
1014
|
+
|
1015
|
+
if (d->state == sc->state && input == sc->input)
|
1016
|
+
return (d->*sc->handler)(position - d->overshootPosition, timestamp);
|
1017
|
+
}
|
1018
|
+
return false;
|
1019
|
+
}
|
1020
|
+
|
1021
|
+
#if !defined(Q_WS_MAC)
|
1022
|
+
// the Mac version is implemented in qtscroller_mac.mm
|
1023
|
+
|
1024
|
+
QPointF QtScrollerPrivate::realDpi(int screen)
|
1025
|
+
{
|
1026
|
+
# ifdef Q_WS_MAEMO_5
|
1027
|
+
Q_UNUSED(screen);
|
1028
|
+
|
1029
|
+
// The DPI value is hardcoded to 96 on Maemo5:
|
1030
|
+
// https://projects.maemo.org/bugzilla/show_bug.cgi?id=152525
|
1031
|
+
// This value (260) is only correct for the N900 though, but
|
1032
|
+
// there's no way to get the real DPI at run time.
|
1033
|
+
return QPointF(260, 260);
|
1034
|
+
|
1035
|
+
# elif defined(Q_WS_X11) && !defined(QT_NO_XRANDR)
|
1036
|
+
// Avoid including the libXRandR header for a very simple struct
|
1037
|
+
struct structXRRScreenSize
|
1038
|
+
{
|
1039
|
+
int width, height;
|
1040
|
+
int mwidth, mheight;
|
1041
|
+
};
|
1042
|
+
typedef structXRRScreenSize *(*PtrXRRSizes)(Display *, int, int *);
|
1043
|
+
typedef int (*PtrXRRRootToScreen)(Display *, Qt::HANDLE);
|
1044
|
+
static PtrXRRSizes ptrXRRSizes = 0;
|
1045
|
+
static PtrXRRRootToScreen ptrXRRRootToScreen = 0;
|
1046
|
+
static bool resolvedXRR = false;
|
1047
|
+
|
1048
|
+
if (!resolvedXRR) {
|
1049
|
+
QLibrary xrandrLib(QLatin1String("Xrandr"), 2);
|
1050
|
+
if (!xrandrLib.load()) { // try without the version number
|
1051
|
+
xrandrLib.setFileName(QLatin1String("Xrandr"));
|
1052
|
+
xrandrLib.load();
|
1053
|
+
}
|
1054
|
+
if (xrandrLib.isLoaded()) {
|
1055
|
+
ptrXRRSizes = (PtrXRRSizes) xrandrLib.resolve("XRRSizes");
|
1056
|
+
ptrXRRRootToScreen = (PtrXRRRootToScreen) xrandrLib.resolve("XRRRootToScreen");
|
1057
|
+
}
|
1058
|
+
resolvedXRR = true;
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
if (ptrXRRSizes && ptrXRRRootToScreen) {
|
1062
|
+
int nsizes = 0;
|
1063
|
+
// QDesktopWidget is based on Xinerama screens, which do not always
|
1064
|
+
// correspond to RandR screens: NVidia's TwinView e.g. will show up
|
1065
|
+
// as 2 screens in QDesktopWidget, but libXRandR will only see 1 screen.
|
1066
|
+
// (although with the combined size of the Xinerama screens).
|
1067
|
+
// Additionally, libXrandr will simply crash when calling XRRSizes
|
1068
|
+
// for (the non-existant) screen 1 in this scenario.
|
1069
|
+
Qt::HANDLE root = QX11Info::appRootWindow(screen == -1 ? QX11Info::appScreen() : screen);
|
1070
|
+
int randrscreen = (root != 0) ? ptrXRRRootToScreen(QX11Info::display(), root) : -1;
|
1071
|
+
|
1072
|
+
structXRRScreenSize *sizes = ptrXRRSizes(QX11Info::display(), randrscreen == -1 ? 0 : randrscreen, &nsizes);
|
1073
|
+
|
1074
|
+
if (nsizes > 0 && sizes && sizes->width && sizes->height && sizes->mwidth && sizes->mheight) {
|
1075
|
+
qScrollerDebug() << "XRandR DPI:" << QPointF(qreal(25.4) * qreal(sizes->width) / qreal(sizes->mwidth),
|
1076
|
+
qreal(25.4) * qreal(sizes->height) / qreal(sizes->mheight));
|
1077
|
+
return QPointF(qreal(25.4) * qreal(sizes->width) / qreal(sizes->mwidth),
|
1078
|
+
qreal(25.4) * qreal(sizes->height) / qreal(sizes->mheight));
|
1079
|
+
}
|
1080
|
+
}
|
1081
|
+
# endif
|
1082
|
+
|
1083
|
+
QWidget *w = QApplication::desktop()->screen(screen);
|
1084
|
+
return QPointF(w->physicalDpiX(), w->physicalDpiY());
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
#endif // !Q_WS_MAC
|
1088
|
+
|
1089
|
+
|
1090
|
+
/*! \internal
|
1091
|
+
Returns the resolution of the used screen.
|
1092
|
+
*/
|
1093
|
+
QPointF QtScrollerPrivate::dpi() const
|
1094
|
+
{
|
1095
|
+
return pixelPerMeter * qreal(0.0254);
|
1096
|
+
}
|
1097
|
+
|
1098
|
+
/*! \internal
|
1099
|
+
Sets the resolution used for scrolling.
|
1100
|
+
This resolution is only used by the kinetic scroller. If you change this
|
1101
|
+
then the scroller will behave quite different as a lot of the values are
|
1102
|
+
given in physical distances (millimeter).
|
1103
|
+
*/
|
1104
|
+
void QtScrollerPrivate::setDpi(const QPointF &dpi)
|
1105
|
+
{
|
1106
|
+
pixelPerMeter = dpi / qreal(0.0254);
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
/*! \internal
|
1110
|
+
Sets the dpi used for scrolling to the value of the widget.
|
1111
|
+
*/
|
1112
|
+
void QtScrollerPrivate::setDpiFromWidget(QWidget *widget)
|
1113
|
+
{
|
1114
|
+
QDesktopWidget *dw = QApplication::desktop();
|
1115
|
+
setDpi(realDpi(widget ? dw->screenNumber(widget) : dw->primaryScreen()));
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
/*! \internal
|
1119
|
+
Updates the velocity during dragging.
|
1120
|
+
Sets releaseVelocity.
|
1121
|
+
*/
|
1122
|
+
void QtScrollerPrivate::updateVelocity(const QPointF &deltaPixelRaw, qint64 deltaTime)
|
1123
|
+
{
|
1124
|
+
if (deltaTime <= 0)
|
1125
|
+
return;
|
1126
|
+
|
1127
|
+
Q_Q(QtScroller);
|
1128
|
+
QPointF ppm = q->pixelPerMeter();
|
1129
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1130
|
+
QPointF deltaPixel = deltaPixelRaw;
|
1131
|
+
|
1132
|
+
qScrollerDebug() << "QtScroller::updateVelocity(" << deltaPixelRaw << " [delta pix], " << deltaTime << " [delta ms])";
|
1133
|
+
|
1134
|
+
// faster than 2.5mm/ms seems bogus (that would be a screen height in ~20 ms)
|
1135
|
+
if (((deltaPixelRaw / qreal(deltaTime)).manhattanLength() / ((ppm.x() + ppm.y()) / 2) * 1000) > qreal(2.5))
|
1136
|
+
deltaPixel = deltaPixelRaw * qreal(2.5) * ppm / 1000 / (deltaPixelRaw / qreal(deltaTime)).manhattanLength();
|
1137
|
+
|
1138
|
+
QPointF newv = -deltaPixel / qreal(deltaTime) * qreal(1000) / ppm;
|
1139
|
+
// around 95% of all updates are in the [1..50] ms range, so make sure
|
1140
|
+
// to scale the smoothing factor over that range: this way a 50ms update
|
1141
|
+
// will have full impact, while 5ms update will only have a 10% impact.
|
1142
|
+
qreal smoothing = sp->dragVelocitySmoothingFactor * qMin(qreal(deltaTime), qreal(50)) / qreal(50);
|
1143
|
+
|
1144
|
+
// only smooth if we already have a release velocity and only if the
|
1145
|
+
// user hasn't stopped to move his finger for more than 100ms
|
1146
|
+
if ((releaseVelocity != QPointF(0, 0)) && (deltaTime < 100)) {
|
1147
|
+
qScrollerDebug() << "SMOOTHED from " << newv << " to " << newv * smoothing + releaseVelocity * (qreal(1) - smoothing);
|
1148
|
+
// smooth x or y only if the new velocity is either 0 or at least in
|
1149
|
+
// the same direction of the release velocity
|
1150
|
+
if (!newv.x() || (qSign(releaseVelocity.x()) == qSign(newv.x())))
|
1151
|
+
newv.setX(newv.x() * smoothing + releaseVelocity.x() * (qreal(1) - smoothing));
|
1152
|
+
if (!newv.y() || (qSign(releaseVelocity.y()) == qSign(newv.y())))
|
1153
|
+
newv.setY(newv.y() * smoothing + releaseVelocity.y() * (qreal(1) - smoothing));
|
1154
|
+
} else
|
1155
|
+
qScrollerDebug() << "NO SMOOTHING to " << newv;
|
1156
|
+
|
1157
|
+
releaseVelocity.setX(qBound(-sp->maximumVelocity, newv.x(), sp->maximumVelocity));
|
1158
|
+
releaseVelocity.setY(qBound(-sp->maximumVelocity, newv.y(), sp->maximumVelocity));
|
1159
|
+
|
1160
|
+
qScrollerDebug() << " --> new velocity:" << releaseVelocity;
|
1161
|
+
}
|
1162
|
+
|
1163
|
+
void QtScrollerPrivate::pushSegment(ScrollType type, qreal deltaTime, qreal stopProgress, qreal startPos, qreal deltaPos, qreal stopPos, QEasingCurve::Type curve, Qt::Orientation orientation)
|
1164
|
+
{
|
1165
|
+
if (startPos == stopPos || deltaPos == 0)
|
1166
|
+
return;
|
1167
|
+
|
1168
|
+
ScrollSegment s;
|
1169
|
+
if (orientation == Qt::Horizontal && !xSegments.isEmpty())
|
1170
|
+
s.startTime = xSegments.last().startTime + xSegments.last().deltaTime * xSegments.last().stopProgress;
|
1171
|
+
else if (orientation == Qt::Vertical && !ySegments.isEmpty())
|
1172
|
+
s.startTime = ySegments.last().startTime + ySegments.last().deltaTime * ySegments.last().stopProgress;
|
1173
|
+
else
|
1174
|
+
s.startTime = monotonicTimer.elapsed();
|
1175
|
+
|
1176
|
+
s.startPos = startPos;
|
1177
|
+
s.deltaPos = deltaPos;
|
1178
|
+
s.stopPos = stopPos;
|
1179
|
+
s.deltaTime = deltaTime * 1000;
|
1180
|
+
s.stopProgress = stopProgress;
|
1181
|
+
s.curve.setType(curve);
|
1182
|
+
s.type = type;
|
1183
|
+
|
1184
|
+
if (orientation == Qt::Horizontal)
|
1185
|
+
xSegments.enqueue(s);
|
1186
|
+
else
|
1187
|
+
ySegments.enqueue(s);
|
1188
|
+
|
1189
|
+
qScrollerDebug() << "+++ Added a new ScrollSegment: " << s;
|
1190
|
+
}
|
1191
|
+
|
1192
|
+
|
1193
|
+
/*! \internal
|
1194
|
+
Clears the old segments and recalculates them if the current segments are not longer valid
|
1195
|
+
*/
|
1196
|
+
void QtScrollerPrivate::recalcScrollingSegments(bool forceRecalc)
|
1197
|
+
{
|
1198
|
+
Q_Q(QtScroller);
|
1199
|
+
QPointF ppm = q->pixelPerMeter();
|
1200
|
+
|
1201
|
+
releaseVelocity = q->velocity();
|
1202
|
+
|
1203
|
+
if (forceRecalc || !scrollingSegmentsValid(Qt::Horizontal))
|
1204
|
+
createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal);
|
1205
|
+
|
1206
|
+
if (forceRecalc || !scrollingSegmentsValid(Qt::Vertical))
|
1207
|
+
createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical);
|
1208
|
+
}
|
1209
|
+
|
1210
|
+
/*! \internal
|
1211
|
+
Returns the end position after the current scroll has finished.
|
1212
|
+
*/
|
1213
|
+
qreal QtScrollerPrivate::scrollingSegmentsEndPos(Qt::Orientation orientation) const
|
1214
|
+
{
|
1215
|
+
if (orientation == Qt::Horizontal) {
|
1216
|
+
if (xSegments.isEmpty())
|
1217
|
+
return contentPosition.x() + overshootPosition.x();
|
1218
|
+
else
|
1219
|
+
return xSegments.last().stopPos;
|
1220
|
+
} else {
|
1221
|
+
if (ySegments.isEmpty())
|
1222
|
+
return contentPosition.y() + overshootPosition.y();
|
1223
|
+
else
|
1224
|
+
return ySegments.last().stopPos;
|
1225
|
+
}
|
1226
|
+
}
|
1227
|
+
|
1228
|
+
/*! \internal
|
1229
|
+
Checks if the scroller segment end in a valid position.
|
1230
|
+
*/
|
1231
|
+
bool QtScrollerPrivate::scrollingSegmentsValid(Qt::Orientation orientation)
|
1232
|
+
{
|
1233
|
+
QQueue<ScrollSegment> *segments;
|
1234
|
+
qreal minPos;
|
1235
|
+
qreal maxPos;
|
1236
|
+
|
1237
|
+
if (orientation == Qt::Horizontal) {
|
1238
|
+
segments = &xSegments;
|
1239
|
+
minPos = contentPosRange.left();
|
1240
|
+
maxPos = contentPosRange.right();
|
1241
|
+
} else {
|
1242
|
+
segments = &ySegments;
|
1243
|
+
minPos = contentPosRange.top();
|
1244
|
+
maxPos = contentPosRange.bottom();
|
1245
|
+
}
|
1246
|
+
|
1247
|
+
if (segments->isEmpty())
|
1248
|
+
return true;
|
1249
|
+
|
1250
|
+
const ScrollSegment &last = segments->last();
|
1251
|
+
qreal stopPos = last.stopPos;
|
1252
|
+
|
1253
|
+
if (last.type == ScrollTypeScrollTo)
|
1254
|
+
return true; // scrollTo is always valid
|
1255
|
+
|
1256
|
+
if (last.type == ScrollTypeOvershoot &&
|
1257
|
+
(stopPos != minPos && stopPos != maxPos))
|
1258
|
+
return false;
|
1259
|
+
|
1260
|
+
if (stopPos < minPos || stopPos > maxPos)
|
1261
|
+
return false;
|
1262
|
+
|
1263
|
+
if (stopPos == minPos || stopPos == maxPos) // the begin and the end of the list are always ok
|
1264
|
+
return true;
|
1265
|
+
|
1266
|
+
qreal nextSnap = nextSnapPos(stopPos, 0, orientation);
|
1267
|
+
if (!qIsNaN(nextSnap) && stopPos != nextSnap)
|
1268
|
+
return false;
|
1269
|
+
|
1270
|
+
return true;
|
1271
|
+
}
|
1272
|
+
|
1273
|
+
/*! \internal
|
1274
|
+
Creates the sections needed to scroll to the specific \a endPos to the segments queue.
|
1275
|
+
*/
|
1276
|
+
void QtScrollerPrivate::createScrollToSegments(qreal v, qreal deltaTime, qreal endPos, Qt::Orientation orientation, ScrollType type)
|
1277
|
+
{
|
1278
|
+
Q_UNUSED(v);
|
1279
|
+
|
1280
|
+
if (orientation == Qt::Horizontal)
|
1281
|
+
xSegments.clear();
|
1282
|
+
else
|
1283
|
+
ySegments.clear();
|
1284
|
+
|
1285
|
+
qScrollerDebug() << "+++ createScrollToSegments: t:" << deltaTime << "ep:" << endPos << "o:" << int(orientation);
|
1286
|
+
|
1287
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1288
|
+
|
1289
|
+
qreal startPos = (orientation == Qt::Horizontal) ? contentPosition.x() + overshootPosition.x()
|
1290
|
+
: contentPosition.y() + overshootPosition.y();
|
1291
|
+
qreal deltaPos = (endPos - startPos) / 2;
|
1292
|
+
|
1293
|
+
pushSegment(type, deltaTime * qreal(0.3), qreal(1.0), startPos, deltaPos, startPos + deltaPos, QEasingCurve::InQuad, orientation);
|
1294
|
+
pushSegment(type, deltaTime * qreal(0.7), qreal(1.0), startPos + deltaPos, deltaPos, endPos, sp->scrollingCurve.type(), orientation);
|
1295
|
+
}
|
1296
|
+
|
1297
|
+
/*! \internal
|
1298
|
+
*/
|
1299
|
+
void QtScrollerPrivate::createScrollingSegments(qreal v, qreal startPos, qreal ppm, Qt::Orientation orientation)
|
1300
|
+
{
|
1301
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1302
|
+
|
1303
|
+
QtScrollerProperties::OvershootPolicy policy;
|
1304
|
+
qreal minPos;
|
1305
|
+
qreal maxPos;
|
1306
|
+
qreal viewSize;
|
1307
|
+
|
1308
|
+
if (orientation == Qt::Horizontal) {
|
1309
|
+
xSegments.clear();
|
1310
|
+
policy = sp->hOvershootPolicy;
|
1311
|
+
minPos = contentPosRange.left();
|
1312
|
+
maxPos = contentPosRange.right();
|
1313
|
+
viewSize = viewportSize.width();
|
1314
|
+
} else {
|
1315
|
+
ySegments.clear();
|
1316
|
+
policy = sp->vOvershootPolicy;
|
1317
|
+
minPos = contentPosRange.top();
|
1318
|
+
maxPos = contentPosRange.bottom();
|
1319
|
+
viewSize = viewportSize.height();
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
bool alwaysOvershoot = (policy == QtScrollerProperties::OvershootAlwaysOn);
|
1323
|
+
bool noOvershoot = (policy == QtScrollerProperties::OvershootAlwaysOff) || !sp->overshootScrollDistanceFactor;
|
1324
|
+
bool canOvershoot = !noOvershoot && (alwaysOvershoot || maxPos);
|
1325
|
+
|
1326
|
+
qScrollerDebug() << "+++ createScrollingSegments: s:" << startPos << "maxPos:" << maxPos << "o:" << int(orientation);
|
1327
|
+
|
1328
|
+
qScrollerDebug() << "v = " << v << ", decelerationFactor = " << sp->decelerationFactor << ", curveType = " << sp->scrollingCurve.type();
|
1329
|
+
|
1330
|
+
// This is only correct for QEasingCurve::OutQuad (linear velocity,
|
1331
|
+
// constant deceleration), but the results look and feel ok for OutExpo
|
1332
|
+
// and OutSine as well
|
1333
|
+
|
1334
|
+
// v(t) = deltaTime * a * 0.5 * differentialForProgress(t / deltaTime)
|
1335
|
+
// v(0) = vrelease
|
1336
|
+
// v(deltaTime) = 0
|
1337
|
+
// deltaTime = (2 * vrelease) / (a * differntial(0))
|
1338
|
+
|
1339
|
+
// pos(t) = integrate(v(t)dt)
|
1340
|
+
// pos(t) = vrelease * t - 0.5 * a * t * t
|
1341
|
+
// pos(t) = deltaTime * a * 0.5 * progress(t / deltaTime) * deltaTime
|
1342
|
+
// deltaPos = pos(deltaTime)
|
1343
|
+
|
1344
|
+
qreal deltaTime = (qreal(2) * qAbs(v)) / (sp->decelerationFactor * differentialForProgress(sp->scrollingCurve, 0));
|
1345
|
+
qreal deltaPos = qSign(v) * deltaTime * deltaTime * qreal(0.5) * sp->decelerationFactor * ppm;
|
1346
|
+
qreal endPos = startPos + deltaPos;
|
1347
|
+
|
1348
|
+
qScrollerDebug() << " Real Delta:" << deltaPos;
|
1349
|
+
|
1350
|
+
// -- determine snap points
|
1351
|
+
qreal nextSnap = nextSnapPos(endPos, 0, orientation);
|
1352
|
+
qreal lowerSnapPos = nextSnapPos(startPos, -1, orientation);
|
1353
|
+
qreal higherSnapPos = nextSnapPos(startPos, 1, orientation);
|
1354
|
+
|
1355
|
+
qScrollerDebug() << " Real Delta:" << lowerSnapPos <<"-"<<nextSnap <<"-"<<higherSnapPos;
|
1356
|
+
|
1357
|
+
// - check if we can reach another snap point
|
1358
|
+
if (nextSnap > higherSnapPos || qIsNaN(higherSnapPos))
|
1359
|
+
higherSnapPos = nextSnap;
|
1360
|
+
if (nextSnap < lowerSnapPos || qIsNaN(lowerSnapPos))
|
1361
|
+
lowerSnapPos = nextSnap;
|
1362
|
+
|
1363
|
+
// -- check if are in overshoot and end in overshoot
|
1364
|
+
if ((startPos < minPos && endPos < minPos) ||
|
1365
|
+
(startPos > maxPos && endPos > maxPos)) {
|
1366
|
+
qreal stopPos = endPos < minPos ? minPos : maxPos;
|
1367
|
+
qreal oDeltaTime = sp->overshootScrollTime;
|
1368
|
+
|
1369
|
+
pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), startPos, stopPos - startPos, stopPos, sp->scrollingCurve.type(), orientation);
|
1370
|
+
return;
|
1371
|
+
}
|
1372
|
+
|
1373
|
+
if (qAbs(v) < sp->minimumVelocity) {
|
1374
|
+
|
1375
|
+
qScrollerDebug() << "### below minimum Vel" << orientation;
|
1376
|
+
|
1377
|
+
// - no snap points or already at one
|
1378
|
+
if (qIsNaN(nextSnap) || nextSnap == startPos)
|
1379
|
+
return; // nothing to do, no scrolling needed.
|
1380
|
+
|
1381
|
+
// - decide which point to use
|
1382
|
+
|
1383
|
+
qreal snapDistance = higherSnapPos - lowerSnapPos;
|
1384
|
+
|
1385
|
+
qreal pressDistance = (orientation == Qt::Horizontal) ?
|
1386
|
+
lastPosition.x() - pressPosition.x() :
|
1387
|
+
lastPosition.y() - pressPosition.y();
|
1388
|
+
|
1389
|
+
// if not dragged far enough, pick the next snap point.
|
1390
|
+
if (sp->snapPositionRatio == 0.0 || qAbs(pressDistance / sp->snapPositionRatio) > snapDistance)
|
1391
|
+
endPos = nextSnap;
|
1392
|
+
else if (pressDistance < 0.0)
|
1393
|
+
endPos = lowerSnapPos;
|
1394
|
+
else
|
1395
|
+
endPos = higherSnapPos;
|
1396
|
+
|
1397
|
+
deltaPos = endPos - startPos;
|
1398
|
+
qreal midPos = startPos + deltaPos * qreal(0.3);
|
1399
|
+
pushSegment(ScrollTypeFlick, sp->snapTime * qreal(0.3), qreal(1.0), startPos, midPos - startPos, midPos, QEasingCurve::InQuad, orientation);
|
1400
|
+
pushSegment(ScrollTypeFlick, sp->snapTime * qreal(0.7), qreal(1.0), midPos, endPos - midPos, endPos, sp->scrollingCurve.type(), orientation);
|
1401
|
+
return;
|
1402
|
+
}
|
1403
|
+
|
1404
|
+
// - go to the next snappoint if there is one
|
1405
|
+
if (v > 0 && !qIsNaN(higherSnapPos)) {
|
1406
|
+
// change the time in relation to the changed end position
|
1407
|
+
if (endPos - startPos)
|
1408
|
+
deltaTime *= qAbs((higherSnapPos - startPos) / (endPos - startPos));
|
1409
|
+
if (deltaTime > sp->snapTime)
|
1410
|
+
deltaTime = sp->snapTime;
|
1411
|
+
endPos = higherSnapPos;
|
1412
|
+
|
1413
|
+
} else if (v < 0 && !qIsNaN(lowerSnapPos)) {
|
1414
|
+
// change the time in relation to the changed end position
|
1415
|
+
if (endPos - startPos)
|
1416
|
+
deltaTime *= qAbs((lowerSnapPos - startPos) / (endPos - startPos));
|
1417
|
+
if (deltaTime > sp->snapTime)
|
1418
|
+
deltaTime = sp->snapTime;
|
1419
|
+
endPos = lowerSnapPos;
|
1420
|
+
|
1421
|
+
// -- check if we are overshooting
|
1422
|
+
} else if (endPos < minPos || endPos > maxPos) {
|
1423
|
+
qreal stopPos = endPos < minPos ? minPos : maxPos;
|
1424
|
+
|
1425
|
+
qScrollerDebug() << "Overshoot: delta:" << (stopPos - startPos);
|
1426
|
+
|
1427
|
+
qreal stopProgress = progressForValue(sp->scrollingCurve, qAbs((stopPos - startPos) / deltaPos));
|
1428
|
+
|
1429
|
+
if (!canOvershoot) {
|
1430
|
+
qScrollerDebug() << "Overshoot stopp:" << stopProgress;
|
1431
|
+
|
1432
|
+
pushSegment(ScrollTypeFlick, deltaTime, stopProgress, startPos, endPos, stopPos, sp->scrollingCurve.type(), orientation);
|
1433
|
+
} else {
|
1434
|
+
qreal oDeltaTime = sp->overshootScrollTime;
|
1435
|
+
qreal oStopProgress = qMin(stopProgress + oDeltaTime * qreal(0.3) / deltaTime, qreal(1));
|
1436
|
+
qreal oDistance = startPos + deltaPos * sp->scrollingCurve.valueForProgress(oStopProgress) - stopPos;
|
1437
|
+
qreal oMaxDistance = qSign(oDistance) * (viewSize * sp->overshootScrollDistanceFactor);
|
1438
|
+
|
1439
|
+
qScrollerDebug() << "1 oDistance:" << oDistance << "Max:" << oMaxDistance << "stopP/oStopP" << stopProgress << oStopProgress;
|
1440
|
+
|
1441
|
+
if (qAbs(oDistance) > qAbs(oMaxDistance)) {
|
1442
|
+
oStopProgress = progressForValue(sp->scrollingCurve, qAbs((stopPos + oMaxDistance - startPos) / deltaPos));
|
1443
|
+
oDistance = oMaxDistance;
|
1444
|
+
qScrollerDebug() << "2 oDistance:" << oDistance << "Max:" << oMaxDistance << "stopP/oStopP" << stopProgress << oStopProgress;
|
1445
|
+
}
|
1446
|
+
|
1447
|
+
pushSegment(ScrollTypeFlick, deltaTime, oStopProgress, startPos, deltaPos, stopPos + oDistance, sp->scrollingCurve.type(), orientation);
|
1448
|
+
pushSegment(ScrollTypeOvershoot, oDeltaTime * qreal(0.7), qreal(1.0), stopPos + oDistance, -oDistance, stopPos, sp->scrollingCurve.type(), orientation);
|
1449
|
+
}
|
1450
|
+
return;
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
pushSegment(ScrollTypeFlick, deltaTime, qreal(1.0), startPos, deltaPos, endPos, sp->scrollingCurve.type(), orientation);
|
1454
|
+
}
|
1455
|
+
|
1456
|
+
|
1457
|
+
/*! \internal
|
1458
|
+
Prepares scrolling by sending a QScrollPrepareEvent to the receiver widget.
|
1459
|
+
Returns true if the scrolling was accepted and a target was returned.
|
1460
|
+
*/
|
1461
|
+
bool QtScrollerPrivate::prepareScrolling(const QPointF &position)
|
1462
|
+
{
|
1463
|
+
QtScrollPrepareEvent spe(position);
|
1464
|
+
spe.ignore();
|
1465
|
+
sendEvent(target, &spe);
|
1466
|
+
|
1467
|
+
qScrollerDebug() << "QScrollPrepareEvent returned from" << target << "with" << spe.isAccepted() << "mcp:" << spe.contentPosRange() << "cp:" << spe.contentPos();
|
1468
|
+
if (spe.isAccepted()) {
|
1469
|
+
QPointF oldContentPos = contentPosition + overshootPosition;
|
1470
|
+
QPointF contentDelta = spe.contentPos() - oldContentPos;
|
1471
|
+
|
1472
|
+
viewportSize = spe.viewportSize();
|
1473
|
+
contentPosRange = spe.contentPosRange();
|
1474
|
+
if (contentPosRange.width() < 0)
|
1475
|
+
contentPosRange.setWidth(0);
|
1476
|
+
if (contentPosRange.height() < 0)
|
1477
|
+
contentPosRange.setHeight(0);
|
1478
|
+
contentPosition = clampToRect(spe.contentPos(), contentPosRange);
|
1479
|
+
overshootPosition = spe.contentPos() - contentPosition;
|
1480
|
+
|
1481
|
+
// - check if the content position was moved
|
1482
|
+
if (contentDelta != QPointF(0, 0)) {
|
1483
|
+
// need to correct all segments
|
1484
|
+
for (int i = 0; i < xSegments.count(); i++)
|
1485
|
+
xSegments[i].startPos -= contentDelta.x();
|
1486
|
+
|
1487
|
+
for (int i = 0; i < ySegments.count(); i++)
|
1488
|
+
ySegments[i].startPos -= contentDelta.y();
|
1489
|
+
}
|
1490
|
+
|
1491
|
+
if (QWidget *w = qobject_cast<QWidget *>(target))
|
1492
|
+
setDpiFromWidget(w);
|
1493
|
+
if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(target)) {
|
1494
|
+
//TODO: the first view isn't really correct - maybe use an additional field in the prepare event?
|
1495
|
+
if (go->scene() && !go->scene()->views().isEmpty())
|
1496
|
+
setDpiFromWidget(go->scene()->views().first());
|
1497
|
+
}
|
1498
|
+
|
1499
|
+
if (state == QtScroller::Scrolling) {
|
1500
|
+
recalcScrollingSegments();
|
1501
|
+
}
|
1502
|
+
return true;
|
1503
|
+
}
|
1504
|
+
|
1505
|
+
return false;
|
1506
|
+
}
|
1507
|
+
|
1508
|
+
void QtScrollerPrivate::handleDrag(const QPointF &position, qint64 timestamp)
|
1509
|
+
{
|
1510
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1511
|
+
|
1512
|
+
QPointF deltaPixel = position - lastPosition;
|
1513
|
+
qint64 deltaTime = timestamp - lastTimestamp;
|
1514
|
+
|
1515
|
+
if (sp->axisLockThreshold) {
|
1516
|
+
int dx = qAbs(deltaPixel.x());
|
1517
|
+
int dy = qAbs(deltaPixel.y());
|
1518
|
+
if (dx || dy) {
|
1519
|
+
bool vertical = (dy > dx);
|
1520
|
+
qreal alpha = qreal(vertical ? dx : dy) / qreal(vertical ? dy : dx);
|
1521
|
+
//qScrollerDebug() << "QtScroller::handleDrag() -- axis lock:" << alpha << " / " << axisLockThreshold << "- isvertical:" << vertical << "- dx:" << dx << "- dy:" << dy;
|
1522
|
+
if (alpha <= sp->axisLockThreshold) {
|
1523
|
+
if (vertical)
|
1524
|
+
deltaPixel.setX(0);
|
1525
|
+
else
|
1526
|
+
deltaPixel.setY(0);
|
1527
|
+
}
|
1528
|
+
}
|
1529
|
+
}
|
1530
|
+
|
1531
|
+
// calculate velocity (if the user would release the mouse NOW)
|
1532
|
+
updateVelocity(deltaPixel, deltaTime);
|
1533
|
+
|
1534
|
+
// restrict velocity, if content is not scrollable
|
1535
|
+
QRectF max = contentPosRange;
|
1536
|
+
bool canScrollX = (max.width() > 0) || (sp->hOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn);
|
1537
|
+
bool canScrollY = (max.height() > 0) || (sp->vOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn);
|
1538
|
+
|
1539
|
+
if (!canScrollX) {
|
1540
|
+
deltaPixel.setX(0);
|
1541
|
+
releaseVelocity.setX(0);
|
1542
|
+
}
|
1543
|
+
if (!canScrollY) {
|
1544
|
+
deltaPixel.setY(0);
|
1545
|
+
releaseVelocity.setY(0);
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
// if (firstDrag) {
|
1549
|
+
// // Do not delay the first drag
|
1550
|
+
// setContentPositionHelper(q->contentPosition() - overshootDistance - deltaPixel);
|
1551
|
+
// dragDistance = QPointF(0, 0);
|
1552
|
+
// } else {
|
1553
|
+
dragDistance += deltaPixel;
|
1554
|
+
// }
|
1555
|
+
//qScrollerDebug() << "######################" << deltaPixel << position.y() << lastPosition.y();
|
1556
|
+
if (canScrollX)
|
1557
|
+
lastPosition.setX(position.x());
|
1558
|
+
if (canScrollY)
|
1559
|
+
lastPosition.setY(position.y());
|
1560
|
+
lastTimestamp = timestamp;
|
1561
|
+
}
|
1562
|
+
|
1563
|
+
bool QtScrollerPrivate::pressWhileInactive(const QPointF &position, qint64 timestamp)
|
1564
|
+
{
|
1565
|
+
if (prepareScrolling(position)) {
|
1566
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1567
|
+
|
1568
|
+
if (!contentPosRange.isNull() ||
|
1569
|
+
(sp->hOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn) ||
|
1570
|
+
(sp->vOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn)) {
|
1571
|
+
|
1572
|
+
lastPosition = pressPosition = position;
|
1573
|
+
lastTimestamp = pressTimestamp = timestamp;
|
1574
|
+
setState(QtScroller::Pressed);
|
1575
|
+
}
|
1576
|
+
}
|
1577
|
+
return false;
|
1578
|
+
}
|
1579
|
+
|
1580
|
+
bool QtScrollerPrivate::releaseWhilePressed(const QPointF &, qint64)
|
1581
|
+
{
|
1582
|
+
if (overshootPosition != QPointF(0.0, 0.0)) {
|
1583
|
+
setState(QtScroller::Scrolling);
|
1584
|
+
return true;
|
1585
|
+
} else {
|
1586
|
+
setState(QtScroller::Inactive);
|
1587
|
+
return false;
|
1588
|
+
}
|
1589
|
+
}
|
1590
|
+
|
1591
|
+
bool QtScrollerPrivate::moveWhilePressed(const QPointF &position, qint64 timestamp)
|
1592
|
+
{
|
1593
|
+
Q_Q(QtScroller);
|
1594
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1595
|
+
QPointF ppm = q->pixelPerMeter();
|
1596
|
+
|
1597
|
+
QPointF deltaPixel = position - pressPosition;
|
1598
|
+
|
1599
|
+
bool moveAborted = false;
|
1600
|
+
bool moveStarted = (((deltaPixel / ppm).manhattanLength()) > sp->dragStartDistance);
|
1601
|
+
|
1602
|
+
// check the direction of the mouse drag and abort if it's too much in the wrong direction.
|
1603
|
+
if (moveStarted) {
|
1604
|
+
QRectF max = contentPosRange;
|
1605
|
+
bool canScrollX = (max.width() > 0);
|
1606
|
+
bool canScrollY = (max.height() > 0);
|
1607
|
+
|
1608
|
+
if (sp->hOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn)
|
1609
|
+
canScrollX = true;
|
1610
|
+
if (sp->vOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn)
|
1611
|
+
canScrollY = true;
|
1612
|
+
|
1613
|
+
if (qAbs(deltaPixel.x() / ppm.x()) < qAbs(deltaPixel.y() / ppm.y())) {
|
1614
|
+
if (!canScrollY)
|
1615
|
+
moveAborted = true;
|
1616
|
+
} else {
|
1617
|
+
if (!canScrollX)
|
1618
|
+
moveAborted = true;
|
1619
|
+
}
|
1620
|
+
}
|
1621
|
+
|
1622
|
+
if (moveAborted) {
|
1623
|
+
setState(QtScroller::Inactive);
|
1624
|
+
moveStarted = false;
|
1625
|
+
|
1626
|
+
} else if (moveStarted) {
|
1627
|
+
setState(QtScroller::Dragging);
|
1628
|
+
|
1629
|
+
// subtract the dragStartDistance
|
1630
|
+
deltaPixel = deltaPixel - deltaPixel * (sp->dragStartDistance / deltaPixel.manhattanLength());
|
1631
|
+
|
1632
|
+
if (deltaPixel != QPointF(0, 0)) {
|
1633
|
+
// handleDrag updates lastPosition, lastTimestamp and velocity
|
1634
|
+
handleDrag(pressPosition + deltaPixel, timestamp);
|
1635
|
+
}
|
1636
|
+
}
|
1637
|
+
return moveStarted;
|
1638
|
+
}
|
1639
|
+
|
1640
|
+
bool QtScrollerPrivate::moveWhileDragging(const QPointF &position, qint64 timestamp)
|
1641
|
+
{
|
1642
|
+
// handleDrag updates lastPosition, lastTimestamp and velocity
|
1643
|
+
handleDrag(position, timestamp);
|
1644
|
+
return true;
|
1645
|
+
}
|
1646
|
+
|
1647
|
+
void QtScrollerPrivate::timerEventWhileDragging()
|
1648
|
+
{
|
1649
|
+
if (dragDistance != QPointF(0, 0)) {
|
1650
|
+
qScrollerDebug() << "QtScroller::timerEventWhileDragging() -- dragDistance:" << dragDistance;
|
1651
|
+
|
1652
|
+
setContentPositionHelperDragging(-dragDistance);
|
1653
|
+
dragDistance = QPointF(0, 0);
|
1654
|
+
}
|
1655
|
+
}
|
1656
|
+
|
1657
|
+
bool QtScrollerPrivate::releaseWhileDragging(const QPointF &position, qint64 timestamp)
|
1658
|
+
{
|
1659
|
+
Q_Q(QtScroller);
|
1660
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1661
|
+
|
1662
|
+
// handleDrag updates lastPosition, lastTimestamp and velocity
|
1663
|
+
handleDrag(position, timestamp);
|
1664
|
+
|
1665
|
+
// check if we moved at all - this can happen if you stop a running
|
1666
|
+
// scroller with a press and release shortly afterwards
|
1667
|
+
QPointF deltaPixel = position - pressPosition;
|
1668
|
+
if (((deltaPixel / q->pixelPerMeter()).manhattanLength()) > sp->dragStartDistance) {
|
1669
|
+
|
1670
|
+
// handle accelerating flicks
|
1671
|
+
if ((oldVelocity != QPointF(0, 0)) && sp->acceleratingFlickMaximumTime &&
|
1672
|
+
((timestamp - pressTimestamp) < qint64(sp->acceleratingFlickMaximumTime * 1000))) {
|
1673
|
+
|
1674
|
+
// - determine if the direction was changed
|
1675
|
+
int signX = 0, signY = 0;
|
1676
|
+
if (releaseVelocity.x())
|
1677
|
+
signX = (releaseVelocity.x() > 0) == (oldVelocity.x() > 0) ? 1 : -1;
|
1678
|
+
if (releaseVelocity.y())
|
1679
|
+
signY = (releaseVelocity.y() > 0) == (oldVelocity.y() > 0) ? 1 : -1;
|
1680
|
+
|
1681
|
+
if (signX > 0)
|
1682
|
+
releaseVelocity.setX(qBound(-sp->maximumVelocity,
|
1683
|
+
oldVelocity.x() * sp->acceleratingFlickSpeedupFactor,
|
1684
|
+
sp->maximumVelocity));
|
1685
|
+
if (signY > 0)
|
1686
|
+
releaseVelocity.setY(qBound(-sp->maximumVelocity,
|
1687
|
+
oldVelocity.y() * sp->acceleratingFlickSpeedupFactor,
|
1688
|
+
sp->maximumVelocity));
|
1689
|
+
}
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
QPointF ppm = q->pixelPerMeter();
|
1693
|
+
createScrollingSegments(releaseVelocity.x(), contentPosition.x() + overshootPosition.x(), ppm.x(), Qt::Horizontal);
|
1694
|
+
createScrollingSegments(releaseVelocity.y(), contentPosition.y() + overshootPosition.y(), ppm.y(), Qt::Vertical);
|
1695
|
+
|
1696
|
+
qScrollerDebug() << "QtScroller::releaseWhileDragging() -- velocity:" << releaseVelocity << "-- minimum velocity:" << sp->minimumVelocity << "overshoot" << overshootPosition;
|
1697
|
+
|
1698
|
+
if (xSegments.isEmpty() && ySegments.isEmpty())
|
1699
|
+
setState(QtScroller::Inactive);
|
1700
|
+
else
|
1701
|
+
setState(QtScroller::Scrolling);
|
1702
|
+
|
1703
|
+
return true;
|
1704
|
+
}
|
1705
|
+
|
1706
|
+
void QtScrollerPrivate::timerEventWhileScrolling()
|
1707
|
+
{
|
1708
|
+
qScrollerDebug() << "QtScroller::timerEventWhileScrolling()";
|
1709
|
+
|
1710
|
+
setContentPositionHelperScrolling();
|
1711
|
+
if (xSegments.isEmpty() && ySegments.isEmpty())
|
1712
|
+
setState(QtScroller::Inactive);
|
1713
|
+
}
|
1714
|
+
|
1715
|
+
bool QtScrollerPrivate::pressWhileScrolling(const QPointF &position, qint64 timestamp)
|
1716
|
+
{
|
1717
|
+
Q_Q(QtScroller);
|
1718
|
+
|
1719
|
+
if ((q->velocity() <= properties.d->maximumClickThroughVelocity) &&
|
1720
|
+
(overshootPosition == QPointF(0.0, 0.0))) {
|
1721
|
+
setState(QtScroller::Inactive);
|
1722
|
+
return false;
|
1723
|
+
} else {
|
1724
|
+
lastPosition = pressPosition = position;
|
1725
|
+
lastTimestamp = pressTimestamp = timestamp;
|
1726
|
+
setState(QtScroller::Pressed);
|
1727
|
+
setState(QtScroller::Dragging);
|
1728
|
+
return true;
|
1729
|
+
}
|
1730
|
+
}
|
1731
|
+
|
1732
|
+
/*! \internal
|
1733
|
+
This function handles all state changes of the scroller.
|
1734
|
+
*/
|
1735
|
+
void QtScrollerPrivate::setState(QtScroller::State newstate)
|
1736
|
+
{
|
1737
|
+
Q_Q(QtScroller);
|
1738
|
+
bool sendLastScroll = false;
|
1739
|
+
|
1740
|
+
if (state == newstate)
|
1741
|
+
return;
|
1742
|
+
|
1743
|
+
qScrollerDebug() << q << "QtScroller::setState(" << stateName(newstate) << ")";
|
1744
|
+
|
1745
|
+
switch (newstate) {
|
1746
|
+
case QtScroller::Inactive:
|
1747
|
+
scrollTimer->stop();
|
1748
|
+
|
1749
|
+
// send the last scroll event (but only after the current state change was finished)
|
1750
|
+
if (!firstScroll)
|
1751
|
+
sendLastScroll = true;
|
1752
|
+
|
1753
|
+
releaseVelocity = QPointF(0, 0);
|
1754
|
+
break;
|
1755
|
+
|
1756
|
+
case QtScroller::Pressed:
|
1757
|
+
scrollTimer->stop();
|
1758
|
+
|
1759
|
+
oldVelocity = releaseVelocity;
|
1760
|
+
releaseVelocity = QPointF(0, 0);
|
1761
|
+
break;
|
1762
|
+
|
1763
|
+
case QtScroller::Dragging:
|
1764
|
+
dragDistance = QPointF(0, 0);
|
1765
|
+
if (state == QtScroller::Pressed)
|
1766
|
+
scrollTimer->start();
|
1767
|
+
break;
|
1768
|
+
|
1769
|
+
case QtScroller::Scrolling:
|
1770
|
+
scrollTimer->start();
|
1771
|
+
break;
|
1772
|
+
}
|
1773
|
+
|
1774
|
+
qSwap(state, newstate);
|
1775
|
+
|
1776
|
+
if (sendLastScroll) {
|
1777
|
+
QtScrollEvent se(contentPosition, overshootPosition, QtScrollEvent::ScrollFinished);
|
1778
|
+
sendEvent(target, &se);
|
1779
|
+
firstScroll = true;
|
1780
|
+
}
|
1781
|
+
if (state == QtScroller::Dragging || state == QtScroller::Scrolling)
|
1782
|
+
activeScrollers.insert(q);
|
1783
|
+
else
|
1784
|
+
activeScrollers.remove(q);
|
1785
|
+
emit q->stateChanged(state);
|
1786
|
+
}
|
1787
|
+
|
1788
|
+
|
1789
|
+
/*! \internal
|
1790
|
+
Helps when setting the content position.
|
1791
|
+
It will try to move the content by the requested delta but stop in case
|
1792
|
+
when we are coming back from an overshoot or a scrollTo.
|
1793
|
+
It will also indicate a new overshooting condition by the overshootX and oversthootY flags.
|
1794
|
+
|
1795
|
+
In this cases it will reset the velocity variables and other flags.
|
1796
|
+
|
1797
|
+
Also keeps track of the current over-shooting value in overshootPosition.
|
1798
|
+
|
1799
|
+
\a deltaPos is the amount of pixels the current content position should be moved
|
1800
|
+
*/
|
1801
|
+
void QtScrollerPrivate::setContentPositionHelperDragging(const QPointF &deltaPos)
|
1802
|
+
{
|
1803
|
+
Q_Q(QtScroller);
|
1804
|
+
QPointF ppm = q->pixelPerMeter();
|
1805
|
+
const QtScrollerPropertiesPrivate *sp = properties.d.data();
|
1806
|
+
QPointF v = q->velocity();
|
1807
|
+
|
1808
|
+
if (sp->overshootDragResistanceFactor)
|
1809
|
+
overshootPosition /= sp->overshootDragResistanceFactor;
|
1810
|
+
|
1811
|
+
QPointF oldPos = contentPosition + overshootPosition;
|
1812
|
+
QPointF newPos = oldPos + deltaPos;
|
1813
|
+
|
1814
|
+
qScrollerDebug() << "QtScroller::setContentPositionHelperDragging(" << deltaPos << " [pix])";
|
1815
|
+
qScrollerDebug() << " --> overshoot:" << overshootPosition << "- old pos:" << oldPos << "- new pos:" << newPos;
|
1816
|
+
|
1817
|
+
QPointF oldClampedPos = clampToRect(oldPos, contentPosRange);
|
1818
|
+
QPointF newClampedPos = clampToRect(newPos, contentPosRange);
|
1819
|
+
|
1820
|
+
// --- handle overshooting and stop if the coordinate is going back inside the normal area
|
1821
|
+
bool alwaysOvershootX = (sp->hOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn);
|
1822
|
+
bool alwaysOvershootY = (sp->vOvershootPolicy == QtScrollerProperties::OvershootAlwaysOn);
|
1823
|
+
bool noOvershootX = (sp->hOvershootPolicy == QtScrollerProperties::OvershootAlwaysOff) ||
|
1824
|
+
((state == QtScroller::Dragging) && !sp->overshootDragResistanceFactor) ||
|
1825
|
+
!sp->overshootDragDistanceFactor;
|
1826
|
+
bool noOvershootY = (sp->vOvershootPolicy == QtScrollerProperties::OvershootAlwaysOff) ||
|
1827
|
+
((state == QtScroller::Dragging) && !sp->overshootDragResistanceFactor) ||
|
1828
|
+
!sp->overshootDragDistanceFactor;
|
1829
|
+
bool canOvershootX = !noOvershootX && (alwaysOvershootX || contentPosRange.width());
|
1830
|
+
bool canOvershootY = !noOvershootY && (alwaysOvershootY || contentPosRange.height());
|
1831
|
+
|
1832
|
+
qreal oldOvershootX = (canOvershootX) ? oldPos.x() - oldClampedPos.x() : 0;
|
1833
|
+
qreal oldOvershootY = (canOvershootY) ? oldPos.y() - oldClampedPos.y() : 0;
|
1834
|
+
|
1835
|
+
qreal newOvershootX = (canOvershootX) ? newPos.x() - newClampedPos.x() : 0;
|
1836
|
+
qreal newOvershootY = (canOvershootY) ? newPos.y() - newClampedPos.y() : 0;
|
1837
|
+
|
1838
|
+
qreal maxOvershootX = viewportSize.width() * sp->overshootDragDistanceFactor;
|
1839
|
+
qreal maxOvershootY = viewportSize.height() * sp->overshootDragDistanceFactor;
|
1840
|
+
|
1841
|
+
qScrollerDebug() << " --> noOs:" << noOvershootX << "drf:" << sp->overshootDragResistanceFactor << "mdf:" << sp->overshootScrollDistanceFactor << "ossP:"<<sp->hOvershootPolicy;
|
1842
|
+
qScrollerDebug() << " --> canOS:" << canOvershootX << "newOS:" << newOvershootX << "maxOS:" << maxOvershootX;
|
1843
|
+
|
1844
|
+
if (sp->overshootDragResistanceFactor) {
|
1845
|
+
oldOvershootX *= sp->overshootDragResistanceFactor;
|
1846
|
+
oldOvershootY *= sp->overshootDragResistanceFactor;
|
1847
|
+
newOvershootX *= sp->overshootDragResistanceFactor;
|
1848
|
+
newOvershootY *= sp->overshootDragResistanceFactor;
|
1849
|
+
}
|
1850
|
+
|
1851
|
+
// -- stop at the maximum overshoot distance
|
1852
|
+
|
1853
|
+
newOvershootX = qBound(-maxOvershootX, newOvershootX, maxOvershootX);
|
1854
|
+
newOvershootY = qBound(-maxOvershootY, newOvershootY, maxOvershootY);
|
1855
|
+
|
1856
|
+
overshootPosition.setX(newOvershootX);
|
1857
|
+
overshootPosition.setY(newOvershootY);
|
1858
|
+
contentPosition = newClampedPos;
|
1859
|
+
|
1860
|
+
QtScrollEvent se(contentPosition, overshootPosition, firstScroll ? QtScrollEvent::ScrollStarted : QtScrollEvent::ScrollUpdated);
|
1861
|
+
sendEvent(target, &se);
|
1862
|
+
firstScroll = false;
|
1863
|
+
|
1864
|
+
qScrollerDebug() << " --> new position:" << newClampedPos << "- new overshoot:" << overshootPosition <<
|
1865
|
+
"- overshoot x/y?:" << overshootPosition;
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
|
1869
|
+
qreal QtScrollerPrivate::nextSegmentPosition(QQueue<ScrollSegment> &segments, qint64 now, qreal oldPos)
|
1870
|
+
{
|
1871
|
+
qreal pos = oldPos;
|
1872
|
+
|
1873
|
+
// check the X segments for new positions
|
1874
|
+
while (!segments.isEmpty()) {
|
1875
|
+
const ScrollSegment s = segments.head();
|
1876
|
+
|
1877
|
+
if ((s.startTime + s.deltaTime * s.stopProgress) <= now) {
|
1878
|
+
segments.dequeue();
|
1879
|
+
pos = s.stopPos;
|
1880
|
+
} else if (s.startTime <= now) {
|
1881
|
+
qreal progress = qreal(now - s.startTime) / qreal(s.deltaTime);
|
1882
|
+
pos = s.startPos + s.deltaPos * s.curve.valueForProgress(progress);
|
1883
|
+
if (s.deltaPos > 0 ? pos > s.stopPos : pos < s.stopPos) {
|
1884
|
+
segments.dequeue();
|
1885
|
+
pos = s.stopPos;
|
1886
|
+
} else {
|
1887
|
+
break;
|
1888
|
+
}
|
1889
|
+
} else {
|
1890
|
+
break;
|
1891
|
+
}
|
1892
|
+
}
|
1893
|
+
return pos;
|
1894
|
+
}
|
1895
|
+
|
1896
|
+
void QtScrollerPrivate::setContentPositionHelperScrolling()
|
1897
|
+
{
|
1898
|
+
qint64 now = monotonicTimer.elapsed();
|
1899
|
+
QPointF newPos = contentPosition + overshootPosition;
|
1900
|
+
|
1901
|
+
newPos.setX(nextSegmentPosition(xSegments, now, newPos.x()));
|
1902
|
+
newPos.setY(nextSegmentPosition(ySegments, now, newPos.y()));
|
1903
|
+
|
1904
|
+
// -- set the position and handle overshoot
|
1905
|
+
qScrollerDebug() << "QtScroller::setContentPositionHelperScrolling()";
|
1906
|
+
qScrollerDebug() << " --> overshoot:" << overshootPosition << "- new pos:" << newPos;
|
1907
|
+
|
1908
|
+
QPointF newClampedPos = clampToRect(newPos, contentPosRange);
|
1909
|
+
|
1910
|
+
overshootPosition = newPos - newClampedPos;
|
1911
|
+
contentPosition = newClampedPos;
|
1912
|
+
|
1913
|
+
QtScrollEvent se(contentPosition, overshootPosition, firstScroll ? QtScrollEvent::ScrollStarted : QtScrollEvent::ScrollUpdated);
|
1914
|
+
sendEvent(target, &se);
|
1915
|
+
firstScroll = false;
|
1916
|
+
|
1917
|
+
qScrollerDebug() << " --> new position:" << newClampedPos << "- new overshoot:" << overshootPosition;
|
1918
|
+
}
|
1919
|
+
|
1920
|
+
/*! \internal
|
1921
|
+
Returns the next snap point in direction.
|
1922
|
+
If \a direction >0 it will return the next snap point that is larger than the current position.
|
1923
|
+
If \a direction <0 it will return the next snap point that is smaller than the current position.
|
1924
|
+
If \a direction ==0 it will return the nearest snap point (or the current position if we are already
|
1925
|
+
on a snap point.
|
1926
|
+
Returns the nearest snap position or NaN if no such point could be found.
|
1927
|
+
*/
|
1928
|
+
qreal QtScrollerPrivate::nextSnapPos(qreal p, int dir, Qt::Orientation orientation)
|
1929
|
+
{
|
1930
|
+
qreal bestSnapPos = Q_QNAN;
|
1931
|
+
qreal bestSnapPosDist = Q_INFINITY;
|
1932
|
+
|
1933
|
+
qreal minPos;
|
1934
|
+
qreal maxPos;
|
1935
|
+
|
1936
|
+
if (orientation == Qt::Horizontal) {
|
1937
|
+
minPos = contentPosRange.left();
|
1938
|
+
maxPos = contentPosRange.right();
|
1939
|
+
} else {
|
1940
|
+
minPos = contentPosRange.top();
|
1941
|
+
maxPos = contentPosRange.bottom();
|
1942
|
+
}
|
1943
|
+
|
1944
|
+
if (orientation == Qt::Horizontal) {
|
1945
|
+
// the snap points in the list
|
1946
|
+
foreach (qreal snapPos, snapPositionsX) {
|
1947
|
+
qreal snapPosDist = snapPos - p;
|
1948
|
+
if ((dir > 0 && snapPosDist < 0) ||
|
1949
|
+
(dir < 0 && snapPosDist > 0))
|
1950
|
+
continue; // wrong direction
|
1951
|
+
if (snapPos < minPos || snapPos > maxPos)
|
1952
|
+
continue; // invalid
|
1953
|
+
|
1954
|
+
if (qIsNaN(bestSnapPos) ||
|
1955
|
+
qAbs(snapPosDist) < bestSnapPosDist) {
|
1956
|
+
bestSnapPos = snapPos;
|
1957
|
+
bestSnapPosDist = qAbs(snapPosDist);
|
1958
|
+
}
|
1959
|
+
}
|
1960
|
+
|
1961
|
+
// the snap point interval
|
1962
|
+
if (snapIntervalX > 0.0) {
|
1963
|
+
qreal first = minPos + snapFirstX;
|
1964
|
+
qreal snapPos;
|
1965
|
+
if (dir > 0)
|
1966
|
+
snapPos = qCeil((p - first) / snapIntervalX) * snapIntervalX + first;
|
1967
|
+
else if (dir < 0)
|
1968
|
+
snapPos = qFloor((p - first) / snapIntervalX) * snapIntervalX + first;
|
1969
|
+
else if (p <= first)
|
1970
|
+
snapPos = first;
|
1971
|
+
else
|
1972
|
+
{
|
1973
|
+
qreal last = qFloor((maxPos - first) / snapIntervalX) * snapIntervalX + first;
|
1974
|
+
if (p >= last)
|
1975
|
+
snapPos = last;
|
1976
|
+
else
|
1977
|
+
snapPos = qRound((p - first) / snapIntervalX) * snapIntervalX + first;
|
1978
|
+
}
|
1979
|
+
|
1980
|
+
if (snapPos >= first && snapPos <= maxPos ) {
|
1981
|
+
qreal snapPosDist = snapPos - p;
|
1982
|
+
|
1983
|
+
if (qIsNaN(bestSnapPos) ||
|
1984
|
+
qAbs(snapPosDist) < bestSnapPosDist) {
|
1985
|
+
bestSnapPos = snapPos;
|
1986
|
+
bestSnapPosDist = qAbs(snapPosDist);
|
1987
|
+
}
|
1988
|
+
}
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
} else { // (orientation == Qt::Vertical)
|
1992
|
+
// the snap points in the list
|
1993
|
+
foreach (qreal snapPos, snapPositionsY) {
|
1994
|
+
qreal snapPosDist = snapPos - p;
|
1995
|
+
if ((dir > 0 && snapPosDist < 0) ||
|
1996
|
+
(dir < 0 && snapPosDist > 0))
|
1997
|
+
continue; // wrong direction
|
1998
|
+
if (snapPos < minPos || snapPos > maxPos)
|
1999
|
+
continue; // invalid
|
2000
|
+
|
2001
|
+
if (qIsNaN(bestSnapPos) ||
|
2002
|
+
qAbs(snapPosDist) < bestSnapPosDist) {
|
2003
|
+
bestSnapPos = snapPos;
|
2004
|
+
bestSnapPosDist = qAbs(snapPosDist);
|
2005
|
+
}
|
2006
|
+
}
|
2007
|
+
|
2008
|
+
// the snap point interval
|
2009
|
+
if (snapIntervalY > 0.0) {
|
2010
|
+
qreal first = minPos + snapFirstY;
|
2011
|
+
qreal snapPos;
|
2012
|
+
if (dir > 0)
|
2013
|
+
snapPos = qCeil((p - first) / snapIntervalY) * snapIntervalY + first;
|
2014
|
+
else if (dir < 0)
|
2015
|
+
snapPos = qFloor((p - first) / snapIntervalY) * snapIntervalY + first;
|
2016
|
+
else if (p <= first)
|
2017
|
+
snapPos = first;
|
2018
|
+
else
|
2019
|
+
{
|
2020
|
+
qreal last = qFloor((maxPos - first) / snapIntervalY) * snapIntervalY + first;
|
2021
|
+
if (p >= last)
|
2022
|
+
snapPos = last;
|
2023
|
+
else
|
2024
|
+
snapPos = qRound((p - first) / snapIntervalY) * snapIntervalY + first;
|
2025
|
+
}
|
2026
|
+
|
2027
|
+
if (snapPos >= first && snapPos <= maxPos ) {
|
2028
|
+
qreal snapPosDist = snapPos - p;
|
2029
|
+
|
2030
|
+
if (qIsNaN(bestSnapPos) ||
|
2031
|
+
qAbs(snapPosDist) < bestSnapPosDist) {
|
2032
|
+
bestSnapPos = snapPos;
|
2033
|
+
bestSnapPosDist = qAbs(snapPosDist);
|
2034
|
+
}
|
2035
|
+
}
|
2036
|
+
}
|
2037
|
+
}
|
2038
|
+
|
2039
|
+
return bestSnapPos;
|
2040
|
+
}
|
2041
|
+
|
2042
|
+
/*!
|
2043
|
+
\enum QtScroller::State
|
2044
|
+
|
2045
|
+
This enum contains the different QtScroller states.
|
2046
|
+
|
2047
|
+
\value Inactive The scroller is not scrolling and nothing is pressed.
|
2048
|
+
\value Pressed A touch event was received or the mouse button was pressed but the scroll area is currently not dragged.
|
2049
|
+
\value Dragging The scroll area is currently following the touch point or mouse.
|
2050
|
+
\value Scrolling The scroll area is moving on it's own.
|
2051
|
+
*/
|
2052
|
+
|
2053
|
+
/*!
|
2054
|
+
\enum QtScroller::ScrollerGestureType
|
2055
|
+
|
2056
|
+
This enum contains the different gesture types that are supported by the QtScroller gesture recognizer.
|
2057
|
+
|
2058
|
+
\value TouchGesture The gesture recognizer will only trigger on touch
|
2059
|
+
events. Specifically it will react on single touch points when using a
|
2060
|
+
touch screen and dual touch points when using a touchpad.
|
2061
|
+
\value LeftMouseButtonGesture The gesture recognizer will only trigger on left mouse button events.
|
2062
|
+
\value MiddleMouseButtonGesture The gesture recognizer will only trigger on middle mouse button events.
|
2063
|
+
\value RightMouseButtonGesture The gesture recognizer will only trigger on right mouse button events.
|
2064
|
+
*/
|
2065
|
+
|
2066
|
+
/*!
|
2067
|
+
\enum QtScroller::Input
|
2068
|
+
|
2069
|
+
This enum contains an input device agnostic view of input events that are relevant for QtScroller.
|
2070
|
+
|
2071
|
+
\value InputPress The user pressed the input device (e.g. QEvent::MouseButtonPress,
|
2072
|
+
QEvent::GraphicsSceneMousePress, QEvent::TouchBegin)
|
2073
|
+
|
2074
|
+
\value InputMove The user moved the input device (e.g. QEvent::MouseMove,
|
2075
|
+
QEvent::GraphicsSceneMouseMove, QEvent::TouchUpdate)
|
2076
|
+
|
2077
|
+
\value InputRelease The user released the input device (e.g. QEvent::MouseButtonRelease,
|
2078
|
+
QEvent::GraphicsSceneMouseRelease, QEvent::TouchEnd)
|
2079
|
+
|
2080
|
+
*/
|
2081
|
+
|