rhodes 3.2.3 → 3.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +10 -0
- data/Rakefile +153 -46
- data/doc/build.txt +261 -102
- data/doc/configuration.txt +5 -2
- data/doc/device-caps.txt +134 -23
- data/doc/extensions.txt +922 -69
- data/doc/generator.txt +96 -39
- data/doc/install.txt +35 -19
- data/doc/jqt-jqm-transition.txt +17 -1
- data/doc/rhom.txt +23 -2
- data/doc/rhostudio-eclipse.txt +49 -0
- data/doc/rhostudio-test-plan.txt +440 -0
- data/doc/simulator.txt +1 -1
- data/doc/synchronization.txt +40 -1
- data/lib/build/jake.rb +108 -7
- data/lib/extensions/barcode/ext/barcode/platform/android/Rakefile +0 -35
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Barcode.xcodeproj/project.pbxproj +8 -2
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeCallbackHelper.mm +195 -195
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Classes/BarcodeViewController.m +6 -0
- data/lib/extensions/barcode/ext/barcode/platform/iphone/Rakefile +5 -0
- data/lib/extensions/barcode/ext/barcode/shared/ruby/barcode_wrap.c +64 -20
- data/lib/extensions/debugger/CHANGELOG +3 -0
- data/lib/extensions/debugger/debugger.rb +26 -21
- data/lib/extensions/digest-md5/ext/Rakefile +5 -5
- data/lib/extensions/digest-md5/ext/build +10 -1
- data/lib/extensions/digest-md5/ext/defs.h +19 -0
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +317 -9
- data/lib/extensions/digest-md5/ext/iphone/Dmd5.xcodeproj/project.pbxproj +290 -0
- data/lib/extensions/digest-md5/ext/iphone/Dmd5_Prefix.pch +7 -0
- data/lib/extensions/digest-md5/ext/iphone/Rakefile +79 -0
- data/lib/extensions/digest-sha1/ext/Rakefile +5 -5
- data/lib/extensions/digest-sha1/ext/build +10 -1
- data/lib/extensions/digest-sha1/ext/defs.h +19 -0
- data/lib/extensions/digest-sha1/ext/digest-sha1.vcproj +317 -9
- data/lib/extensions/digest-sha1/ext/iphone/Dsha1.xcodeproj/project.pbxproj +278 -0
- data/lib/extensions/digest-sha1/ext/iphone/Dsha1_Prefix.pch +7 -0
- data/lib/extensions/digest-sha1/ext/iphone/Rakefile +79 -0
- data/lib/extensions/digest/ext/Rakefile +5 -5
- data/lib/extensions/digest/ext/build +10 -1
- data/lib/extensions/digest/ext/digest.vcproj +317 -9
- data/lib/extensions/digest/ext/iphone/Digest.xcodeproj/project.pbxproj +270 -0
- data/lib/extensions/digest/ext/iphone/Digest_Prefix.pch +7 -0
- data/lib/extensions/digest/ext/iphone/Rakefile +79 -0
- data/lib/extensions/esri/ext/esri/platform/iphone/ESRI.xcodeproj/project.pbxproj +10 -2
- data/lib/extensions/esri/ext/esri/platform/iphone/Rakefile +6 -0
- data/lib/extensions/fcntl/ext/Rakefile +5 -5
- data/lib/extensions/fcntl/ext/build +9 -1
- data/lib/extensions/fcntl/ext/iphone/Fcntl.xcodeproj/project.pbxproj +262 -0
- data/lib/extensions/fcntl/ext/iphone/Fcntl_Prefix.pch +7 -0
- data/lib/extensions/fcntl/ext/iphone/Rakefile +79 -0
- data/lib/extensions/net-http/net/http.rb +9 -7
- data/lib/extensions/nfc/ext/nfc/shared/ruby/nfc_wrap.c +64 -20
- data/lib/extensions/rhoxml/rexml/document.rb +3 -2
- data/lib/extensions/rhoxml/rexml/instruction.rb +70 -0
- data/lib/framework/builtinME.rb +9 -0
- data/lib/framework/date/format.rb +1 -1
- data/lib/framework/dateME.rb +19 -2
- data/lib/framework/rho/rho.rb +15 -4
- data/lib/framework/rho/rhoapplication.rb +1 -0
- data/lib/framework/rho/rhocontact.rb +10 -27
- data/lib/framework/rho/rhoevent_c.rb +8 -2
- data/lib/framework/rho/rhosupport.rb +25 -0
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/rhoframework.rb +15 -0
- data/lib/framework/rholang/localization_simplified.rb +8 -10
- data/lib/framework/rhom/rhom_object_factory.rb +8 -2
- data/lib/framework/version.rb +1 -1
- data/lib/rhodes.rb +1 -1
- data/platform/android/Rhodes/jni/Application.mk +2 -1
- data/platform/android/Rhodes/jni/include/rhodes.h +9 -0
- data/platform/android/Rhodes/jni/src/callbacks.cpp +31 -1
- data/platform/android/Rhodes/jni/src/event.cpp +75 -31
- data/platform/android/Rhodes/jni/src/nativeview.cpp +1 -1
- data/platform/android/Rhodes/jni/src/phonebook.cpp +73 -9
- data/platform/android/Rhodes/jni/src/rhodes.cpp +21 -0
- data/platform/android/Rhodes/jni/src/rhodesapp.cpp +16 -24
- data/platform/android/Rhodes/jni/src/signature.cpp +27 -1
- data/platform/android/Rhodes/{default.properties → project.properties} +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +14 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/NativeBar.java +14 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java +38 -115
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +69 -52
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +9 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraNewService.java +21 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraOldService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraSemiService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/CameraService.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +38 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/Event.java +212 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/event/EventStore.java +82 -125
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +2 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +39 -19
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +106 -136
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +26 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/nativeview/RhoNativeViewManager.java +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality.java +40 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality01.java +47 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality02.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality03.java +33 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality04.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality05.java +75 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality06.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality07.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality08.java +44 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality09.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionality10.java +34 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/osfunctionality/AndroidFunctionalityManager.java +73 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Contact.java +57 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessor.java +2 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorNew.java +322 -76
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/ContactAccessorOld.java +11 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +5 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/ChromeClientOld.java +2 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/GoogleWebView.java +125 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/RhoWebSettingsOld.java +2 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/webview/WebView.java +16 -0
- data/platform/android/build/RhodesSRC_build.files +14 -0
- data/platform/android/build/android.rake +149 -147
- data/platform/android/build/android_tools.rb +58 -0
- data/platform/android/build/librhocommon_build.files +1 -0
- data/platform/android/build/libruby_build.files +3 -0
- data/platform/bb/RubyVM/src/com/rho/RhoConf.java +11 -1
- data/platform/bb/RubyVM/src/com/rho/db/DBAdapter.java +11 -5
- data/platform/bb/RubyVM/src/com/rho/db/DBAttrManager.java +3 -2
- data/platform/bb/RubyVM/src/com/rho/file/RhoFile.java +2 -0
- data/platform/bb/RubyVM/src/com/rho/net/RhoConnection.java +20 -8
- data/platform/bb/RubyVM/src/com/rho/sync/SyncEngine.java +9 -6
- data/platform/bb/RubyVM/src/com/rho/sync/SyncSource.java +45 -18
- data/platform/bb/RubyVM/src/com/rho/sync/SyncThread.java +1 -2
- data/platform/bb/build/bb.rake +84 -70
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +106 -14
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +1 -1
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +108 -16
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +10 -5
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +21 -4
- data/platform/bb/rhodes/src/rhomobile/mapview/Annotation.java +17 -0
- data/platform/bb/rhodes/src/rhomobile/mapview/MapView.java +8 -5
- data/platform/bb/rhodes/src/rhomobile/mapview/MapViewScreen.java +3 -1
- data/platform/iphone/Classes/AppManager/AppManager.m +15 -3
- data/platform/iphone/Classes/Event/Event.m +45 -2
- data/platform/iphone/Classes/MapView/MapViewController.m +8 -4
- data/platform/iphone/Classes/Phonebook/phonebook.m +30 -7
- data/platform/iphone/Classes/Rhodes.h +11 -1
- data/platform/iphone/Classes/Rhodes.m +141 -9
- data/platform/iphone/Classes/Signature/SignatureDelegate.m +27 -1
- data/platform/iphone/Classes/SimpleMainView.h +1 -0
- data/platform/iphone/Classes/SimpleMainView.m +4 -0
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +31 -1
- data/platform/iphone/curl/curl.xcodeproj/project.pbxproj +10 -0
- data/platform/iphone/rbuild/iphone.rake +33 -6
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +10 -2
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +22 -2
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +14 -0
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +10 -0
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/Info.plist +1 -1
- data/platform/osx/bin/RhoSimulator/RhoSimulator.app/Contents/MacOS/RhoSimulator +0 -0
- data/platform/osx/build/osx.rake +58 -7
- data/platform/shared/RhoConnectClient/RhoConnectClient.cpp +427 -69
- data/platform/shared/RhoConnectClient/RhoConnectClient.h +21 -2
- data/platform/shared/common/Android.mk +2 -1
- data/platform/shared/common/AutoPointer.h +23 -0
- data/platform/shared/common/BundleManager.cpp +333 -0
- data/platform/shared/common/RhoFile.cpp +206 -23
- data/platform/shared/common/RhoFile.h +14 -4
- data/platform/shared/common/RhoFilePath.h +18 -0
- data/platform/shared/common/RhoStd.h +11 -1
- data/platform/shared/common/RhoThread.h +4 -1
- data/platform/shared/common/RhodesApp.cpp +31 -8
- data/platform/shared/common/RhodesApp.h +14 -0
- data/platform/shared/common/RhodesAppBase.cpp +6 -6
- data/platform/shared/common/RhodesAppBase.h +1 -1
- data/platform/shared/common/emml.h +34 -0
- data/platform/shared/common/iphone/RhoFileImpl.m +30 -2
- data/platform/shared/common/map/BaseMapEngine.cpp +3 -3
- data/platform/shared/common/map/GeocodingMapEngine.cpp +205 -14
- data/platform/shared/common/map/GeocodingMapEngine.h +25 -2
- data/platform/shared/common/map/MapEngine.cpp +24 -2
- data/platform/shared/common/map/MapEngine.h +23 -12
- data/platform/shared/common/phonebook/PhonebookParams.cpp +99 -0
- data/platform/shared/common/phonebook/PhonebookParams.h +52 -0
- data/platform/shared/common/rhoparams.cpp +14 -0
- data/platform/shared/common/rhoparams.h +1 -0
- data/platform/shared/db/DBAdapter.cpp +43 -24
- data/platform/shared/db/DBAdapter.h +6 -1
- data/platform/shared/db/DBAttrManager.cpp +50 -1
- data/platform/shared/logging/RhoLog.h +3 -0
- data/platform/shared/logging/RhoLogSink.cpp +5 -1
- data/platform/shared/net/CURLNetRequest.cpp +2 -0
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +14 -1
- data/platform/shared/qt/rhodes/impl/PhonebookImpl.cpp +2 -2
- data/platform/shared/qt/rhodes/impl/RhoFileImpl.cpp +1 -1
- data/platform/shared/qt/rhodes/impl/SignatureImpl.cpp +14 -2
- data/platform/shared/qt/rhodes/impl/SystemImpl.cpp +16 -2
- data/platform/shared/qt/rhodes/main.cpp +28 -0
- data/platform/shared/qt/rhodes/rhodes.pro +3 -0
- data/platform/shared/qt/rholib/rholib.pro +2 -1
- data/platform/shared/qt/rubylib/rubylib.pro +2 -1
- data/platform/shared/ruby/Android.mk +3 -0
- data/platform/shared/ruby/class.c +7 -0
- data/platform/shared/ruby/compile.c +18 -10
- data/platform/shared/ruby/encdb.h +18 -8
- data/platform/shared/ruby/eval.c +108 -2
- data/platform/shared/ruby/ext/alert/alert_wrap.c +64 -20
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +64 -20
- data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +67 -23
- data/platform/shared/ruby/ext/calendar/calendar_wrap.c +64 -20
- data/platform/shared/ruby/ext/calendar/event_wrap.c +64 -20
- data/platform/shared/ruby/ext/camera/camera_wrap.c +64 -20
- data/platform/shared/ruby/ext/datetimepicker/datetimepicker_wrap.c +64 -20
- data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -0
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +127 -26
- data/platform/shared/ruby/ext/mapview/mapview_wrap.c +64 -20
- data/platform/shared/ruby/ext/nativebar/nativebar_wrap.c +65 -21
- data/platform/shared/ruby/ext/nativeviewmanager/nativeviewmanager_wrap.c +64 -20
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +64 -20
- data/platform/shared/ruby/ext/phonebook/phonebook.i +7 -7
- data/platform/shared/ruby/ext/phonebook/phonebook_wrap.c +95 -120
- data/platform/shared/ruby/ext/rho/rhoruby.c +4 -4
- data/platform/shared/ruby/ext/rho/rhoruby.h +2 -0
- data/platform/shared/ruby/ext/rho/rhosupport.c +39 -6
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +65 -21
- data/platform/shared/ruby/ext/ringtones/ringtones_wrap.c +64 -20
- data/platform/shared/ruby/ext/signature/signature.i +37 -5
- data/platform/shared/ruby/ext/signature/signature_wrap.c +274 -45
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +65 -21
- data/platform/shared/ruby/ext/system/system.i +14 -2
- data/platform/shared/ruby/ext/system/system_wrap.c +146 -25
- data/platform/shared/ruby/ext/webview/webview_wrap.c +65 -21
- data/platform/shared/ruby/include/ruby/ruby.h +15 -4
- data/platform/shared/ruby/inits.c +1 -0
- data/platform/shared/ruby/io.c +13 -3
- data/platform/shared/ruby/win32/win32.c +3 -3
- data/platform/shared/ruby/wince/io_wce.c +2 -2
- data/platform/shared/rubyext/System.cpp +9 -5
- data/platform/shared/sync/ClientRegister.cpp +18 -8
- data/platform/shared/sync/SyncEngine.cpp +25 -11
- data/platform/shared/sync/SyncEngine.h +2 -0
- data/platform/shared/sync/SyncSource.cpp +40 -15
- data/platform/shared/sync/SyncSource.h +3 -2
- data/platform/shared/sync/SyncThread.cpp +9 -4
- data/platform/shared/sync/SyncThread.h +3 -1
- data/platform/symbian/build/symbian.rake +14 -9
- data/platform/symbian/rhodes/rhodes.pro +11 -8
- data/platform/symbian/rhodes/src/phonebook/ruby_phonebook.cpp +2 -2
- data/platform/symbian/rubylib/rubylib.pro +3 -0
- data/platform/win32/RhoSimulator/RhoSimulator.exe +0 -0
- data/platform/wm/RhoLib/RhoLib.vcproj +315 -2
- data/platform/wm/build/build_inf.js +235 -187
- data/platform/wm/build/wm.rake +388 -233
- data/platform/wm/rhodes.sln +56 -0
- data/platform/wm/rhodes/MainWindow.cpp +139 -77
- data/platform/wm/rhodes/MainWindow.h +27 -22
- data/platform/wm/rhodes/MapView/{Graphics.cpp → Bitmap.cpp} +15 -253
- data/platform/wm/rhodes/MapView/Bitmap.h +86 -0
- data/platform/wm/rhodes/MapView/MapViewManager.cpp +7 -2
- data/platform/wm/rhodes/MapView/MapViewManager.h +1 -1
- data/platform/wm/rhodes/MapView/Win32Graphics.cpp +263 -0
- data/platform/wm/rhodes/MapView/Win32Graphics.h +133 -0
- data/platform/wm/rhodes/MapView/WmGraphics.cpp +291 -0
- data/platform/wm/rhodes/MapView/{Graphics.h → WmGraphics.h} +14 -56
- data/platform/wm/rhodes/Rhodes.cpp +128 -32
- data/platform/wm/rhodes/Rhodes.rc +6 -2
- data/platform/wm/rhodes/camera/Camera.cpp +1 -0
- data/platform/wm/rhodes/phonebook/phonebook.cpp +2 -2
- data/platform/wm/rhodes/phonebook/phonebook.h +2 -2
- data/platform/wm/rhodes/resource.h +3 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +6 -0
- data/platform/wm/rhodes/rho/rubyext/NativeToolbar.cpp +4 -0
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.cpp +675 -0
- data/platform/wm/rhodes/rho/rubyext/RhoSignature.h +123 -0
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +12 -2
- data/platform/wm/rhodes/rhodes.vcproj +2732 -1113
- data/platform/wm/rhodes/simulator/MainWindowQt.h +1 -1
- data/platform/wm/rhodes/stdafx.h +1 -0
- data/platform/wm/rhoelements.sln +118 -62
- data/platform/wm/rubylib/rubylib.vcproj +345 -16
- data/platform/wm/sqlite3/sqlite3.vcproj +305 -0
- data/platform/wm/syncengine/syncengine.vcproj +309 -0
- data/platform/wm/tools/detool/LogServer.cpp +19 -2
- data/platform/wm/tools/detool/detool.cpp +131 -6
- data/platform/wm/tools/detool/detool.vcproj +3 -1
- data/platform/wm/tools/detool/stdafx.h +1 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Libraries/Builtins/RangeOps.cs +589 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Builtins/RubyEncoding.cs +678 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs +271 -0
- data/platform/wp7/IronRuby/Languages/Ruby/Ruby/Runtime/RubyUtils.cs +31 -1
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.Libraries.dll +0 -0
- data/platform/wp7/IronRuby/bin/Silverlight3Release/IronRuby.dll +0 -0
- data/platform/wp7/RhoRubyLib/common/RhoStd.cs +6 -0
- data/platform/wp7/RhoRubyLib/common/RhodesApp.cs +16 -2
- data/platform/wp7/RhoRubyLib/net/NetRequest.cs +2 -0
- data/platform/wp7/RhoRubyLib/rubyext/RhoSyncEngine.cs +1 -2
- data/platform/wp7/RhoRubyLib/sync/SyncEngine.cs +13 -10
- data/platform/wp7/RhoRubyLib/sync/SyncSource.cs +30 -8
- data/platform/wp7/build/wp.rake +5 -0
- data/rakefile.rb +153 -46
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyerrors.swg +155 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyhead.swg +158 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyiterators.swg +932 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubyrun.swg +448 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubystdfunctors.swg +162 -0
- data/res/build-tools/swig_patch/Lib/ruby/rubytracking.swg +159 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_basic_string.i +97 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_map.i +418 -0
- data/res/build-tools/swig_patch/Lib/ruby/std_multimap.i +227 -0
- data/res/build-tools/swig_patch/Lib/swiginit.swg +269 -0
- data/res/build-tools/swig_patch/README +7 -0
- data/res/generators/templates/application/app/Settings/controller.rb +42 -1
- data/res/generators/templates/application/app/Settings/wait.erb +1 -1
- data/res/generators/templates/application/app/application.rb +1 -1
- data/res/generators/templates/application/app/layout.erb +8 -8
- data/res/generators/templates/application/build.yml +0 -1
- data/res/generators/templates/application/public/css/android.css +6 -0
- data/res/generators/templates/application/public/css/blackberry.css +6 -0
- data/res/generators/templates/application/public/css/iphone.css +6 -0
- data/res/generators/templates/application/public/css/jqmobile-patch.css +14 -0
- data/res/generators/templates/application/public/jqmobile/images/ajax-loader.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.0rc1.css → jquery.mobile-1.0.css} +452 -354
- data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0rc1.js → jquery.mobile-1.0.js} +629 -442
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.css +2 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0.min.js +172 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.css +714 -0
- data/res/generators/templates/application/public/jqmobile/jquery.mobile.structure-1.0.min.css +2 -0
- data/res/generators/templates/application/public/js/jqmobile-patch.js +136 -7
- data/res/generators/templates/extension/app/MontanaTest/controller.rb +20 -20
- data/res/generators/templates/extension/app/MontanaTest/index.erb +17 -17
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Montana.xcodeproj/project.pbxproj +8 -2
- data/res/generators/templates/extension/extensions/montana/ext/montana/platform/iphone/Rakefile +5 -0
- data/res/generators/templates/extension/extensions/montana/ext/montana/shared/ruby/montana_wrap.c +64 -20
- data/rhomobile-debug.gemspec +1 -1
- data/spec/framework_spec/app/layout.erb +1 -1
- data/spec/framework_spec/app/spec/core/rational/Rational_spec.rb +1 -1
- data/spec/framework_spec/app/spec/library/stringio/shared/each_char.rb +6 -2
- data/spec/framework_spec/app/spec/shared/rational/{Rational.rb → rational_main.rb} +0 -0
- data/spec/framework_spec/build.yml +0 -3
- data/spec/perfomance_spec/app/Benchmark/controller.rb +1 -1
- data/spec/perfomance_spec/app/layout.erb +1 -1
- data/spec/phone_spec/app/BlobTest_s/blob_test_s.rb +13 -0
- data/spec/phone_spec/app/BlobTest_s/test.png +0 -0
- data/spec/phone_spec/app/BlobTest_s/test2.png +0 -0
- data/spec/phone_spec/app/spec/blobsync_spec.rb +27 -15
- data/spec/phone_spec/app/spec/date_spec.rb +27 -1
- data/spec/phone_spec/app/spec/rho_spec.rb +6 -0
- data/spec/phone_spec/app/spec/rhom_object_spec.rb +64 -26
- data/spec/phone_spec/app/spec/syncengine_spec.rb +28 -7
- data/spec/phone_spec/app/spec/uri_spec.rb +4 -4
- data/spec/phone_spec/app/spec_runner.rb +4 -2
- data/spec/phone_spec/build.yml +7 -9
- data/spec/phone_spec/rhoconfig.txt +1 -0
- data/version +1 -1
- metadata +75 -22
- data/Manifest.txt +0 -7853
- data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.cpp +0 -384
- data/platform/wm/rhodes/rhoelements/RhoWKBrowserEngine.h +0 -41
- data/platform/wm/rhodes/signature/Signature.cpp +0 -396
- data/platform/wm/rhodes/signature/Signature.h +0 -84
- data/platform/wm/rubylib/rubylib.vcproj.VLAD.Vladimir.user +0 -429
- data/platform/wm/sqlite3/sqlite3.vcproj.VLAD.Vladimir.user +0 -429
- data/platform/wm/syncengine/syncengine.vcproj.VLAD.Vladimir.user +0 -429
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.css +0 -12
- data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0rc1.min.js +0 -170
- data/rhomobile-debug-1.0.5.gem +0 -0
@@ -25,8 +25,9 @@
|
|
25
25
|
#define IDD_DIALOG1 122
|
26
26
|
#define IDD_SYNCSTATUS 122
|
27
27
|
#define IDD_MAPVIEW 123
|
28
|
-
#define IDD_DIALOG2 124
|
29
28
|
#define IDD_TAKE_SIGNATURE 124
|
29
|
+
#define IDR_SIGNATURE_MENU 126
|
30
|
+
#define IDM_SAVE 127
|
30
31
|
#define IDC_STATIC_PROMPT 1001
|
31
32
|
#define IDC_EDIT_URL 1002
|
32
33
|
#define IDC_LOGEDIT 1003
|
@@ -88,7 +89,7 @@
|
|
88
89
|
//
|
89
90
|
#ifdef APSTUDIO_INVOKED
|
90
91
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
91
|
-
#define _APS_NEXT_RESOURCE_VALUE
|
92
|
+
#define _APS_NEXT_RESOURCE_VALUE 128
|
92
93
|
#define _APS_NEXT_COMMAND_VALUE 40031
|
93
94
|
#define _APS_NEXT_CONTROL_VALUE 1022
|
94
95
|
#define _APS_NEXT_SYMED_VALUE 111
|
@@ -130,6 +130,12 @@ void CNetRequestImpl::init(const char* method, const String& strUrl, IRhoSession
|
|
130
130
|
break;
|
131
131
|
}
|
132
132
|
|
133
|
+
int timeout = rho_conf_getInt("net_timeout")*1000;
|
134
|
+
if (timeout == 0 )
|
135
|
+
timeout = 30000;
|
136
|
+
|
137
|
+
InternetSetOption( m_hInternet, INTERNET_OPTION_RECEIVE_TIMEOUT, &timeout, sizeof(timeout) );
|
138
|
+
|
133
139
|
m_strReqUrlW = m_uri.lpszUrlPath;
|
134
140
|
m_strReqUrlW += m_uri.lpszExtraInfo;
|
135
141
|
DWORD dwFlags = INTERNET_FLAG_KEEP_CONNECTION|INTERNET_FLAG_NO_CACHE_WRITE|INTERNET_FLAG_NO_COOKIES|INTERNET_FLAG_NO_AUTO_REDIRECT;
|
@@ -91,6 +91,10 @@ static int getColorFromString(const char* szColor)
|
|
91
91
|
|
92
92
|
void CNativeToolbar::createToolbar(rho_param *p)
|
93
93
|
{
|
94
|
+
//#if defined( OS_PLATFORM_MOTCE )
|
95
|
+
// return;
|
96
|
+
//#endif
|
97
|
+
|
94
98
|
if (!rho_rhodesapp_check_mode() || !rho_wmsys_has_touchscreen() )
|
95
99
|
return;
|
96
100
|
|
@@ -0,0 +1,675 @@
|
|
1
|
+
#include "StdAfx.h"
|
2
|
+
|
3
|
+
#include "RhoSignature.h"
|
4
|
+
#include "common/RhodesApp.h"
|
5
|
+
#include "common/RhoTime.h"
|
6
|
+
#include "common/RhoFilePath.h"
|
7
|
+
#include "common/app_build_capabilities.h"
|
8
|
+
|
9
|
+
#if defined(_WIN32_WCE)&& !defined( OS_PLATFORM_MOTCE )
|
10
|
+
#include <msinkaut.h>
|
11
|
+
#include <msinkaut_i.c>
|
12
|
+
#endif
|
13
|
+
|
14
|
+
#if defined(_WIN32_WCE)
|
15
|
+
#include <imaging.h>
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
19
|
+
extern void *rho_wmimpl_createSignatureInstance(HINSTANCE hInst, HWND hWnd, RECT rcWnd, int bgColor, int penColor, int penWidth);
|
20
|
+
extern void rho_wmimpl_deleteSignature(void *inkImpl);
|
21
|
+
extern LRESULT rho_wmimpl_signatureSigProcCall(void *inkImpl, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
22
|
+
extern void rho_wmimpl_signatureClearScreenCall(void *inkImpl);
|
23
|
+
extern BOOL rho_wmimpl_saveSignature(void *inkImpl, LPCTSTR szFilePathName);
|
24
|
+
#endif
|
25
|
+
|
26
|
+
extern "C" HWND getMainWnd();
|
27
|
+
|
28
|
+
namespace rho
|
29
|
+
{
|
30
|
+
using namespace common;
|
31
|
+
|
32
|
+
CRhoSignatureWindow* CRhoSignature::m_pSigWindow = 0;
|
33
|
+
CRhoSignature::CRhoSignature(void)
|
34
|
+
{
|
35
|
+
}
|
36
|
+
|
37
|
+
CRhoSignature::~CRhoSignature(void)
|
38
|
+
{
|
39
|
+
}
|
40
|
+
|
41
|
+
/*static*/ void CRhoSignature::takeSignature(CParams* params)
|
42
|
+
{
|
43
|
+
CModalParams& oSigParams = *((CModalParams*)params);
|
44
|
+
CRhoSignatureWindow oSigWnd(params);
|
45
|
+
int retVal = oSigWnd.DoModal(getMainWnd());
|
46
|
+
oSigWnd.m_hWnd = 0;
|
47
|
+
|
48
|
+
String strStatus = retVal != IDOK ? "" : ((oSigWnd.getLatestHResult() != S_OK && oSigWnd.getLatestHResult() != S_FALSE ? "Error" : ""));
|
49
|
+
CFilePath oFilePath(oSigParams.getFilePath());
|
50
|
+
|
51
|
+
RHODESAPP().callSignatureCallback( oSigParams.m_callback_url, oFilePath.getBaseName(), strStatus, retVal != IDOK );
|
52
|
+
}
|
53
|
+
|
54
|
+
/*static*/ void CRhoSignature::showSignature(CParams* params)
|
55
|
+
{
|
56
|
+
CNonModalParams& oSigParams = *((CNonModalParams*)params);
|
57
|
+
if (oSigParams.m_bVisible)
|
58
|
+
{
|
59
|
+
m_pSigWindow = new CRhoSignatureWindow(params);
|
60
|
+
m_pSigWindow->Create(getMainWnd());
|
61
|
+
m_pSigWindow->ShowWindow(SW_SHOW);
|
62
|
+
|
63
|
+
}else
|
64
|
+
hideSignature();
|
65
|
+
}
|
66
|
+
|
67
|
+
/*static*/ void CRhoSignature::saveSignature(CParams* params)
|
68
|
+
{
|
69
|
+
CModalParams& oSigParams = *((CModalParams*)params);
|
70
|
+
|
71
|
+
if (m_pSigWindow)
|
72
|
+
{
|
73
|
+
m_pSigWindow->saveImage();
|
74
|
+
|
75
|
+
String strStatus = m_pSigWindow->getLatestHResult() != S_OK && m_pSigWindow->getLatestHResult() != S_FALSE ? "Error" : "";
|
76
|
+
CFilePath oFilePath(m_pSigWindow->getParams().getFilePath());
|
77
|
+
|
78
|
+
RHODESAPP().callSignatureCallback( oSigParams.m_callback_url, oFilePath.getBaseName(), strStatus, false );
|
79
|
+
}else
|
80
|
+
RHODESAPP().callSignatureCallback( oSigParams.m_callback_url, "", "Error", false );
|
81
|
+
}
|
82
|
+
|
83
|
+
/*static*/ void CRhoSignature::clearSignature(int )
|
84
|
+
{
|
85
|
+
if (m_pSigWindow)
|
86
|
+
m_pSigWindow->clearImage();
|
87
|
+
}
|
88
|
+
|
89
|
+
/*static*/ void CRhoSignature::hideSignature()
|
90
|
+
{
|
91
|
+
if (m_pSigWindow)
|
92
|
+
{
|
93
|
+
m_pSigWindow->DestroyWindow();
|
94
|
+
m_pSigWindow->m_hWnd = 0;
|
95
|
+
delete m_pSigWindow;
|
96
|
+
m_pSigWindow = 0;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
LRESULT CRhoSignatureWindow::OnDestroyDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
|
101
|
+
{
|
102
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
103
|
+
|
104
|
+
if (m_pInkImpl != NULL )
|
105
|
+
{
|
106
|
+
rho_wmimpl_deleteSignature(m_pInkImpl);
|
107
|
+
}
|
108
|
+
#else
|
109
|
+
|
110
|
+
#if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
|
111
|
+
if (m_pInkImpl != NULL)
|
112
|
+
{
|
113
|
+
((IInkOverlay*)m_pInkImpl)->Release();
|
114
|
+
}
|
115
|
+
#endif
|
116
|
+
|
117
|
+
#endif
|
118
|
+
|
119
|
+
if ( m_hWndCommandBar )
|
120
|
+
::DestroyWindow(m_hWndCommandBar);
|
121
|
+
|
122
|
+
m_hWndCommandBar = 0;
|
123
|
+
|
124
|
+
m_pInkImpl = NULL;
|
125
|
+
return FALSE;
|
126
|
+
}
|
127
|
+
|
128
|
+
LRESULT CRhoSignatureWindow::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
129
|
+
{
|
130
|
+
if ( getParams().hasBorder() )
|
131
|
+
SetWindowLong(GWL_STYLE,(long)WS_BORDER);
|
132
|
+
|
133
|
+
CRect rcWnd = getParams().getWndRect();
|
134
|
+
MoveWindow(rcWnd);
|
135
|
+
|
136
|
+
if (getParams().m_eType == CRhoSignature::esModal)
|
137
|
+
{
|
138
|
+
|
139
|
+
#if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
|
140
|
+
SetWindowText(_T("Take signature"));
|
141
|
+
|
142
|
+
SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN };
|
143
|
+
RHO_ASSERT(SHInitDialog(&shidi));
|
144
|
+
|
145
|
+
SHMENUBARINFO mbi = { sizeof(mbi), 0 };
|
146
|
+
mbi.hwndParent = m_hWnd;
|
147
|
+
mbi.nToolBarId = IDR_GETURL_MENUBAR;
|
148
|
+
mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
|
149
|
+
RHO_ASSERT(SHCreateMenuBar(&mbi));
|
150
|
+
#elif defined( OS_PLATFORM_MOTCE )
|
151
|
+
m_hWndCommandBar = CommandBar_Create(_AtlBaseModule.GetResourceInstance(), m_hWnd, 1);
|
152
|
+
TBBUTTON oBtn = {0};
|
153
|
+
oBtn.iBitmap = -1;
|
154
|
+
oBtn.idCommand = IDM_CLEAR;
|
155
|
+
oBtn.fsState = TBSTATE_ENABLED;
|
156
|
+
oBtn.iString = (int)L"Clear";
|
157
|
+
|
158
|
+
CommandBar_InsertButton(m_hWndCommandBar, 0, &oBtn);
|
159
|
+
CommandBar_AddAdornments(m_hWndCommandBar, CMDBAR_OK, 0 );
|
160
|
+
|
161
|
+
CommandBar_Show(m_hWndCommandBar, TRUE);
|
162
|
+
#endif
|
163
|
+
|
164
|
+
}else
|
165
|
+
{
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
170
|
+
//CSignature* pRESig = new CSignature(_AtlBaseModule.GetResourceInstance(), getMainWnd(), 0, 0);
|
171
|
+
//pRESig->RhoInitialise(m_hWnd, rcWnd, getParams().getBgColor(), getParams().getPenColor(), getParams().getPenWidth());
|
172
|
+
m_pInkImpl = rho_wmimpl_createSignatureInstance(_AtlBaseModule.GetResourceInstance(), m_hWnd, (RECT)rcWnd,
|
173
|
+
getParams().getBgColor(), getParams().getPenColor(), getParams().getPenWidth());
|
174
|
+
#elif defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
|
175
|
+
HRESULT hr = S_OK;
|
176
|
+
HRESULT co_init_result = CoInitializeEx(NULL, 0); //COINIT_APARTMENTTHREADED
|
177
|
+
if ( (co_init_result == S_OK) || (co_init_result == S_FALSE) )
|
178
|
+
{
|
179
|
+
IInkOverlay* pInkOverlay = 0;
|
180
|
+
hr = ::CoCreateInstance(CLSID_InkOverlay,
|
181
|
+
NULL,
|
182
|
+
CLSCTX_INPROC_SERVER,
|
183
|
+
IID_IInkOverlay,
|
184
|
+
(void **)&pInkOverlay);
|
185
|
+
if (pInkOverlay != NULL)
|
186
|
+
{
|
187
|
+
m_pInkImpl = pInkOverlay;
|
188
|
+
|
189
|
+
CComPtr<IInkDrawingAttributes> spIInkDrawAttrs = NULL;
|
190
|
+
hr = pInkOverlay->get_DefaultDrawingAttributes(&spIInkDrawAttrs);
|
191
|
+
if (SUCCEEDED(hr))
|
192
|
+
{
|
193
|
+
spIInkDrawAttrs->put_Color(getParams().getPenColor());
|
194
|
+
//HIMETRIC = (PIXEL * 2540) / 96
|
195
|
+
spIInkDrawAttrs->put_Width( ((float)getParams().getPenWidth()*2540)/96 );
|
196
|
+
|
197
|
+
// Set the new drawing attributes
|
198
|
+
pInkOverlay->putref_DefaultDrawingAttributes(spIInkDrawAttrs);
|
199
|
+
}
|
200
|
+
|
201
|
+
// Attach the inkoverlay object to the window and enable it to start collecting ink
|
202
|
+
pInkOverlay->put_hWnd((long)m_hWnd);
|
203
|
+
hr = pInkOverlay->put_Enabled(VARIANT_TRUE);
|
204
|
+
}
|
205
|
+
else {
|
206
|
+
RAWLOG_ERROR("ERROR: Can not get Ink Overlay in Signature Capture !");
|
207
|
+
}
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
RAWLOG_ERROR("ERROR: Can not Signature CoInitialize !");
|
211
|
+
}
|
212
|
+
#endif //!APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
213
|
+
|
214
|
+
return FALSE;
|
215
|
+
}
|
216
|
+
|
217
|
+
LRESULT CRhoSignatureWindow::OnClearCommand(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
218
|
+
{
|
219
|
+
clearImage();
|
220
|
+
return FALSE;
|
221
|
+
}
|
222
|
+
|
223
|
+
LRESULT CRhoSignatureWindow::OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
224
|
+
{
|
225
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
226
|
+
return rho_wmimpl_signatureSigProcCall(m_pInkImpl, m_hWnd, uMsg, wParam, lParam);
|
227
|
+
#else
|
228
|
+
bHandled = FALSE;
|
229
|
+
#endif
|
230
|
+
return TRUE;
|
231
|
+
}
|
232
|
+
|
233
|
+
LRESULT CRhoSignatureWindow::OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
234
|
+
{
|
235
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
236
|
+
return rho_wmimpl_signatureSigProcCall(m_pInkImpl, m_hWnd, uMsg, wParam, lParam);
|
237
|
+
#else
|
238
|
+
bHandled = FALSE;
|
239
|
+
#endif
|
240
|
+
return TRUE;
|
241
|
+
}
|
242
|
+
|
243
|
+
LRESULT CRhoSignatureWindow::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
244
|
+
{
|
245
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
246
|
+
return rho_wmimpl_signatureSigProcCall(m_pInkImpl, m_hWnd, uMsg, wParam, lParam);
|
247
|
+
#else
|
248
|
+
bHandled = FALSE;
|
249
|
+
#endif
|
250
|
+
return TRUE;
|
251
|
+
}
|
252
|
+
|
253
|
+
LRESULT CRhoSignatureWindow::OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
254
|
+
{
|
255
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
256
|
+
return rho_wmimpl_signatureSigProcCall(m_pInkImpl, m_hWnd, uMsg, wParam, lParam);
|
257
|
+
#else
|
258
|
+
CPaintDC oPaintDC(m_hWnd);
|
259
|
+
CRect rcClient;
|
260
|
+
GetClientRect(rcClient);
|
261
|
+
oPaintDC.FillSolidRect(rcClient, getParams().getBgColor());
|
262
|
+
bHandled = TRUE;
|
263
|
+
#endif
|
264
|
+
return TRUE;
|
265
|
+
}
|
266
|
+
|
267
|
+
void CRhoSignatureWindow::saveImage()
|
268
|
+
{
|
269
|
+
StringW strFilePathW = convertToStringW( getParams().getFilePath() );
|
270
|
+
|
271
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
272
|
+
BOOL bRes = rho_wmimpl_saveSignature( m_pInkImpl, strFilePathW.c_str());
|
273
|
+
m_hResult = bRes ? S_OK : E_FAIL;
|
274
|
+
#else
|
275
|
+
HBITMAP hBitmap = getScreenBitmap();
|
276
|
+
m_hResult = saveBitmapToFile( hBitmap, strFilePathW.c_str(), convertToStringW(getParams().getFileFormat()).c_str() );
|
277
|
+
DeleteObject(hBitmap);
|
278
|
+
#endif
|
279
|
+
}
|
280
|
+
|
281
|
+
void CRhoSignatureWindow::clearImage()
|
282
|
+
{
|
283
|
+
#ifdef APP_BUILD_CAPABILITY_WEBKIT_BROWSER
|
284
|
+
if (m_pInkImpl != NULL)
|
285
|
+
{
|
286
|
+
rho_wmimpl_signatureClearScreenCall(m_pInkImpl);
|
287
|
+
}
|
288
|
+
#else
|
289
|
+
|
290
|
+
#if defined(_WIN32_WCE) && !defined( OS_PLATFORM_MOTCE )
|
291
|
+
if (m_pInkImpl != NULL)
|
292
|
+
{
|
293
|
+
CComPtr<IInkDisp> pDisp;
|
294
|
+
HRESULT hRes = ((IInkOverlay*)m_pInkImpl)->get_Ink(&pDisp);
|
295
|
+
if ( SUCCEEDED(hRes) && pDisp )
|
296
|
+
{
|
297
|
+
pDisp->DeleteStrokes();
|
298
|
+
|
299
|
+
InvalidateRect(NULL,TRUE);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
#endif
|
303
|
+
|
304
|
+
#endif
|
305
|
+
}
|
306
|
+
|
307
|
+
LRESULT CRhoSignatureWindow::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND hwnd, BOOL& /*bHandled*/)
|
308
|
+
{
|
309
|
+
saveImage();
|
310
|
+
|
311
|
+
if (getParams().m_eType == CRhoSignature::esModal)
|
312
|
+
EndDialog(wID);
|
313
|
+
|
314
|
+
return 0;
|
315
|
+
}
|
316
|
+
|
317
|
+
LRESULT CRhoSignatureWindow::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
318
|
+
{
|
319
|
+
if (getParams().m_eType == CRhoSignature::esModal)
|
320
|
+
EndDialog(wID);
|
321
|
+
|
322
|
+
return 0;
|
323
|
+
}
|
324
|
+
|
325
|
+
HBITMAP CRhoSignatureWindow::getScreenBitmap()
|
326
|
+
{
|
327
|
+
// get screen rectangle
|
328
|
+
CRect windowRect;
|
329
|
+
GetWindowRect(&windowRect);
|
330
|
+
|
331
|
+
int nTopHeader = 0;
|
332
|
+
if ( m_hWndCommandBar )
|
333
|
+
{
|
334
|
+
CRect rc;
|
335
|
+
::GetWindowRect(m_hWndCommandBar, &rc);
|
336
|
+
nTopHeader = rc.Height();
|
337
|
+
}
|
338
|
+
|
339
|
+
boolean hasBorder = getParams().hasBorder();
|
340
|
+
if (hasBorder)
|
341
|
+
windowRect.DeflateRect(1,1);
|
342
|
+
|
343
|
+
windowRect.top += nTopHeader;
|
344
|
+
|
345
|
+
// bitmap dimensions
|
346
|
+
int bitmap_dx = windowRect.right - windowRect.left;
|
347
|
+
int bitmap_dy = windowRect.bottom - windowRect.top;
|
348
|
+
|
349
|
+
// create bitmap info header
|
350
|
+
BITMAPINFOHEADER infoHeader = {0};
|
351
|
+
infoHeader.biSize = sizeof(infoHeader);
|
352
|
+
infoHeader.biWidth = bitmap_dx;
|
353
|
+
infoHeader.biHeight = bitmap_dy;
|
354
|
+
infoHeader.biPlanes = 1;
|
355
|
+
infoHeader.biBitCount = 24;
|
356
|
+
infoHeader.biCompression = BI_RGB;
|
357
|
+
|
358
|
+
// dibsection information
|
359
|
+
BITMAPINFO info;
|
360
|
+
info.bmiHeader = infoHeader;
|
361
|
+
HDC winDC = GetWindowDC();
|
362
|
+
HDC memDC = CreateCompatibleDC(winDC);
|
363
|
+
BYTE* memory = 0;
|
364
|
+
HBITMAP bitmap = CreateDIBSection(winDC, &info, DIB_RGB_COLORS, (void**)&memory, 0, 0);
|
365
|
+
HBITMAP old_selected = (HBITMAP)SelectObject(memDC, bitmap);
|
366
|
+
// Copies screen upside down (as it is already upside down) - if need normal layout, change to BitBlt function call
|
367
|
+
StretchBlt(memDC, 0, 0, bitmap_dx, bitmap_dy, winDC, hasBorder ? 1 : 0, bitmap_dy+(hasBorder ? 1 : 0)+nTopHeader, bitmap_dx, bitmap_dy * -1, SRCCOPY);
|
368
|
+
SelectObject(memDC, old_selected);
|
369
|
+
DeleteDC(memDC);
|
370
|
+
ReleaseDC(winDC);
|
371
|
+
|
372
|
+
return bitmap;
|
373
|
+
}
|
374
|
+
|
375
|
+
HRESULT CRhoSignatureWindow::saveBitmapToFile( HBITMAP hBitmap, LPCTSTR filename, LPCTSTR format)
|
376
|
+
{
|
377
|
+
HRESULT res = S_OK;
|
378
|
+
#if defined(_WIN32_WCE) //&& !defined( OS_PLATFORM_MOTCE )
|
379
|
+
IImagingFactory* factory=NULL;
|
380
|
+
if (CoCreateInstance(CLSID_ImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IImagingFactory, (void**)&factory) == S_OK) {
|
381
|
+
UINT count;
|
382
|
+
ImageCodecInfo* imageCodecInfo=NULL;
|
383
|
+
if (factory->GetInstalledEncoders(&count, &imageCodecInfo) == S_OK) {
|
384
|
+
// Get the particular encoder to use
|
385
|
+
LPTSTR formatString;
|
386
|
+
if (wcscmp(format, L"png") == 0) {
|
387
|
+
formatString = _T("image/png");
|
388
|
+
} else if (wcscmp(format, L"jpg") == 0) {
|
389
|
+
formatString = _T("image/jpeg");
|
390
|
+
} else if (wcscmp(format, L"gif") == 0) {
|
391
|
+
formatString = _T("image/gif");
|
392
|
+
} else if (wcscmp(format, L"bmp") == 0) {
|
393
|
+
formatString = _T("image/bmp");
|
394
|
+
} else {
|
395
|
+
factory->Release();
|
396
|
+
CoUninitialize();
|
397
|
+
return S_FALSE;
|
398
|
+
}
|
399
|
+
CLSID encoderClassId;
|
400
|
+
if (count == 0) {
|
401
|
+
factory->Release();
|
402
|
+
return S_FALSE;
|
403
|
+
}
|
404
|
+
for(int i=0; i < (int)count; i++) {
|
405
|
+
if (wcscmp(imageCodecInfo[i].MimeType, formatString) == 0) {
|
406
|
+
encoderClassId= imageCodecInfo[i].Clsid;
|
407
|
+
free(imageCodecInfo);
|
408
|
+
break;
|
409
|
+
} else {
|
410
|
+
continue;
|
411
|
+
}
|
412
|
+
factory->Release();
|
413
|
+
return S_FALSE;
|
414
|
+
}
|
415
|
+
IImageEncoder* imageEncoder=NULL;
|
416
|
+
if (factory->CreateImageEncoderToFile(&encoderClassId, filename, &imageEncoder) == S_OK) {
|
417
|
+
IImageSink* imageSink = NULL;
|
418
|
+
res = imageEncoder->GetEncodeSink(&imageSink);
|
419
|
+
|
420
|
+
if (res != S_OK) {
|
421
|
+
imageEncoder->TerminateEncoder();
|
422
|
+
imageEncoder->Release();
|
423
|
+
factory->Release();
|
424
|
+
return res;
|
425
|
+
}
|
426
|
+
|
427
|
+
BITMAP bm;
|
428
|
+
GetObject (hBitmap, sizeof(BITMAP), &bm);
|
429
|
+
PixelFormatID pixelFormat;
|
430
|
+
switch (bm.bmBitsPixel) {
|
431
|
+
case 1: {
|
432
|
+
pixelFormat = PixelFormat1bppIndexed;
|
433
|
+
break;
|
434
|
+
}
|
435
|
+
case 4: {
|
436
|
+
pixelFormat = PixelFormat4bppIndexed;
|
437
|
+
break;
|
438
|
+
}
|
439
|
+
case 8: {
|
440
|
+
pixelFormat = PixelFormat8bppIndexed;
|
441
|
+
break;
|
442
|
+
}
|
443
|
+
case 24: {
|
444
|
+
pixelFormat = PixelFormat24bppRGB;
|
445
|
+
break;
|
446
|
+
}
|
447
|
+
default: {
|
448
|
+
pixelFormat = PixelFormat32bppARGB;
|
449
|
+
break;
|
450
|
+
}
|
451
|
+
}
|
452
|
+
|
453
|
+
BitmapData* bmData = new BitmapData();
|
454
|
+
bmData->Height = bm.bmHeight;
|
455
|
+
bmData->Width = bm.bmWidth;
|
456
|
+
bmData->Scan0 = bm.bmBits;
|
457
|
+
bmData->PixelFormat = pixelFormat;
|
458
|
+
|
459
|
+
UINT bitsPerLine = bm.bmWidth * bm.bmBitsPixel;
|
460
|
+
UINT bitAlignment = sizeof(LONG) * 8;
|
461
|
+
UINT bitStride = bitAlignment * (bitsPerLine / bitAlignment); // The image buffer is always padded to LONG boundaries
|
462
|
+
if ((bitsPerLine % bitAlignment) != 0) bitStride += bitAlignment; // Add a bit more for the leftover values
|
463
|
+
bmData->Stride = (bitStride / 8);
|
464
|
+
|
465
|
+
IBitmapImage* pBitmap;
|
466
|
+
factory->CreateBitmapFromBuffer(bmData, &pBitmap);
|
467
|
+
IImage* pImage;
|
468
|
+
pBitmap->QueryInterface(IID_IImage, (void**)&pImage);
|
469
|
+
res = pImage->PushIntoSink(imageSink);
|
470
|
+
if (res != S_OK) {
|
471
|
+
delete bmData;
|
472
|
+
pBitmap->Release();
|
473
|
+
pImage->Release();
|
474
|
+
if (imageSink != NULL) {
|
475
|
+
imageSink->Release();
|
476
|
+
}
|
477
|
+
imageEncoder->TerminateEncoder();
|
478
|
+
imageEncoder->Release();
|
479
|
+
factory->Release();
|
480
|
+
return res;
|
481
|
+
}
|
482
|
+
|
483
|
+
delete bmData;
|
484
|
+
pBitmap->Release();
|
485
|
+
pImage->Release();
|
486
|
+
imageSink->Release();
|
487
|
+
imageEncoder->TerminateEncoder();
|
488
|
+
imageEncoder->Release();
|
489
|
+
}
|
490
|
+
}
|
491
|
+
}
|
492
|
+
else {
|
493
|
+
RAWLOG_ERROR("ERROR: Can not Signature Bitmap preparing get Image Factory !");
|
494
|
+
}
|
495
|
+
factory->Release();
|
496
|
+
#endif
|
497
|
+
|
498
|
+
return res;
|
499
|
+
}
|
500
|
+
|
501
|
+
static void readIntFromParam(rho_param* params, const char* szName, long& res)
|
502
|
+
{
|
503
|
+
rho_param* p = rho_param_hash_get(params, szName);
|
504
|
+
if ( p )
|
505
|
+
convertFromStringA( p->v.string, res );
|
506
|
+
}
|
507
|
+
|
508
|
+
CRect CRhoSignature::CParams::getWndRect()
|
509
|
+
{
|
510
|
+
CRect rcDefault, rcWnd(-1,-1,-1,-1);
|
511
|
+
if (m_params)
|
512
|
+
{
|
513
|
+
readIntFromParam(m_params, "left", rcWnd.left);
|
514
|
+
readIntFromParam(m_params, "top", rcWnd.top);
|
515
|
+
readIntFromParam(m_params, "width", rcWnd.right);
|
516
|
+
rcWnd.right += rcWnd.left > 0 ? rcWnd.left : 0;
|
517
|
+
readIntFromParam(m_params, "height", rcWnd.bottom);
|
518
|
+
rcWnd.bottom += rcWnd.top > 0 ? rcWnd.top : 0;
|
519
|
+
}
|
520
|
+
|
521
|
+
if ( m_eType == esModal )
|
522
|
+
{
|
523
|
+
::GetWindowRect(getMainWnd(), rcDefault);
|
524
|
+
}else
|
525
|
+
{
|
526
|
+
rcDefault = CRect(15, 60, 15 + 200, 60 + 150);
|
527
|
+
}
|
528
|
+
|
529
|
+
if (rcWnd.left == -1)
|
530
|
+
rcWnd.left = rcDefault.left;
|
531
|
+
if (rcWnd.top == -1)
|
532
|
+
rcWnd.top = rcDefault.top;
|
533
|
+
if (rcWnd.right == -1)
|
534
|
+
rcWnd.right = rcDefault.right;
|
535
|
+
if (rcWnd.bottom == -1)
|
536
|
+
rcWnd.bottom = rcDefault.bottom;
|
537
|
+
|
538
|
+
return rcWnd;
|
539
|
+
}
|
540
|
+
|
541
|
+
const String& CRhoSignature::CParams::getFilePath()
|
542
|
+
{
|
543
|
+
if ( m_strFilePath.length() > 0 )
|
544
|
+
return m_strFilePath;
|
545
|
+
|
546
|
+
if (m_params)
|
547
|
+
{
|
548
|
+
rho_param* pFP = rho_param_hash_get(m_params, "filePath");
|
549
|
+
if ( pFP )
|
550
|
+
m_strFilePath = pFP->v.string;
|
551
|
+
}
|
552
|
+
|
553
|
+
if ( m_strFilePath.length() > 0 )
|
554
|
+
return m_strFilePath;
|
555
|
+
|
556
|
+
m_strFilePath = RHODESAPPBASE().getBlobsDirPath() + "/Image_" + CLocalTime().toString(true,true) + "." + getFileFormat();
|
557
|
+
|
558
|
+
return m_strFilePath;
|
559
|
+
}
|
560
|
+
|
561
|
+
const String& CRhoSignature::CParams::getFileFormat()
|
562
|
+
{
|
563
|
+
if ( m_strFileFormat.length() > 0 )
|
564
|
+
return m_strFileFormat;
|
565
|
+
|
566
|
+
if (m_params)
|
567
|
+
{
|
568
|
+
rho_param* pFF = rho_param_hash_get(m_params, "imageFormat");
|
569
|
+
if ( pFF )
|
570
|
+
m_strFileFormat = pFF->v.string;
|
571
|
+
}
|
572
|
+
|
573
|
+
if ( m_strFileFormat.length() > 0 )
|
574
|
+
return m_strFileFormat;
|
575
|
+
|
576
|
+
m_strFileFormat = "png";
|
577
|
+
|
578
|
+
return m_strFileFormat;
|
579
|
+
}
|
580
|
+
|
581
|
+
static int getColorFromString(const char* szColor)
|
582
|
+
{
|
583
|
+
if ( !szColor || !*szColor )
|
584
|
+
return RGB(0, 0, 0);
|
585
|
+
|
586
|
+
int c = atoi(szColor);
|
587
|
+
|
588
|
+
int cR = (c & 0xFF0000) >> 16;
|
589
|
+
int cG = (c & 0xFF00) >> 8;
|
590
|
+
int cB = (c & 0xFF);
|
591
|
+
|
592
|
+
return RGB(cR, cG, cB);
|
593
|
+
}
|
594
|
+
|
595
|
+
int CRhoSignature::CParams::getPenColor()
|
596
|
+
{
|
597
|
+
COLORREF color = RGB(0,0,0);
|
598
|
+
|
599
|
+
if (m_params)
|
600
|
+
{
|
601
|
+
rho_param* p = rho_param_hash_get(m_params, "penColor");
|
602
|
+
if ( p )
|
603
|
+
color = getColorFromString(p->v.string);
|
604
|
+
}
|
605
|
+
|
606
|
+
return color;
|
607
|
+
}
|
608
|
+
|
609
|
+
int CRhoSignature::CParams::getBgColor()
|
610
|
+
{
|
611
|
+
COLORREF color = RGB(255,255,255);
|
612
|
+
|
613
|
+
if (m_params)
|
614
|
+
{
|
615
|
+
rho_param* p = rho_param_hash_get(m_params, "bgColor");
|
616
|
+
if ( p )
|
617
|
+
color = getColorFromString(p->v.string);
|
618
|
+
}
|
619
|
+
|
620
|
+
return color;
|
621
|
+
}
|
622
|
+
|
623
|
+
int CRhoSignature::CParams::getPenWidth()
|
624
|
+
{
|
625
|
+
long nw = 1;
|
626
|
+
|
627
|
+
if (m_params)
|
628
|
+
readIntFromParam(m_params, "penWidth", nw);
|
629
|
+
|
630
|
+
return (int)nw;
|
631
|
+
}
|
632
|
+
|
633
|
+
boolean CRhoSignature::CParams::hasBorder()
|
634
|
+
{
|
635
|
+
long nw = 0;
|
636
|
+
|
637
|
+
if (m_params)
|
638
|
+
{
|
639
|
+
rho_param* p = rho_param_hash_get(m_params, "border");
|
640
|
+
if ( p && (strcasecmp(p->v.string, "true") == 0 || strcasecmp(p->v.string, "1") == 0 ) )
|
641
|
+
nw = 1;
|
642
|
+
}
|
643
|
+
|
644
|
+
return nw != 0;
|
645
|
+
}
|
646
|
+
|
647
|
+
}
|
648
|
+
|
649
|
+
extern "C"
|
650
|
+
{
|
651
|
+
|
652
|
+
using namespace rho;
|
653
|
+
using namespace common;
|
654
|
+
|
655
|
+
void rho_signature_take(char* callback_url, rho_param* p)
|
656
|
+
{
|
657
|
+
rho_callInUIThread(CRhoSignature::takeSignature, new CRhoSignature::CModalParams(callback_url, p));
|
658
|
+
}
|
659
|
+
|
660
|
+
void rho_signature_visible(bool b, rho_param* p)
|
661
|
+
{
|
662
|
+
rho_callInUIThread(CRhoSignature::showSignature, new CRhoSignature::CNonModalParams(b, p));
|
663
|
+
}
|
664
|
+
|
665
|
+
void rho_signature_capture(const char* callback_url)
|
666
|
+
{
|
667
|
+
rho_callInUIThread(CRhoSignature::saveSignature, new CRhoSignature::CModalParams(callback_url, 0));
|
668
|
+
}
|
669
|
+
|
670
|
+
void rho_signature_clear()
|
671
|
+
{
|
672
|
+
rho_callInUIThread(CRhoSignature::clearSignature, 0);
|
673
|
+
}
|
674
|
+
|
675
|
+
}
|