rhodes 1.5.5 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/Manifest.txt +214 -32
- data/Rakefile +33 -10
- data/bin/upgrade-rhodes-app +0 -1
- data/lib/build/compileERB/bb.rb +2 -2
- data/lib/build/compileERB/default.rb +7 -5
- data/lib/build/jake.rb +1 -1
- data/lib/extensions/digest-md5/ext.yml +1 -1
- data/lib/extensions/digest-md5/ext/Rakefile +35 -36
- data/lib/extensions/digest-md5/ext/build.bat +1 -0
- data/lib/extensions/digest-md5/ext/digest-md5.vcproj +203 -0
- data/lib/extensions/digest-sha1/ext.yml +1 -1
- data/lib/extensions/digest/ext.yml +1 -1
- data/lib/extensions/digest/ext/Rakefile +35 -39
- data/lib/extensions/digest/ext/build.bat +1 -2
- data/lib/extensions/digest/ext/digest.vcproj +203 -0
- data/lib/framework/rho/render.rb +79 -22
- data/lib/framework/rho/rho.rb +294 -56
- data/lib/framework/rho/rhoapplication.rb +10 -0
- data/lib/framework/rho/rhofsconnector.rb +2 -6
- data/lib/framework/rho/rhoutils.rb +56 -14
- data/lib/framework/rho/rhoviewhelpers.rb +2 -0
- data/lib/framework/rhodes.rb +2 -2
- data/lib/framework/rhom/rhom.rb +42 -15
- data/lib/framework/rhom/rhom_db_adapter.rb +165 -159
- data/lib/framework/rhom/rhom_object.rb +0 -1
- data/lib/framework/rhom/rhom_object_factory.rb +343 -166
- data/lib/framework/rhom/rhom_source.rb +28 -15
- data/lib/framework/version.rb +2 -2
- data/lib/rhodes.rb +2 -2
- data/platform/android/Rhodes/AndroidManifest.xml +2 -2
- data/platform/android/Rhodes/gen/com/rhomobile/rhodes/R.java +39 -44
- data/platform/android/Rhodes/jni/include/JNIRhodes.h +1 -1
- data/platform/android/Rhodes/jni/include/details/rhojava.inc +23 -20
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_RhoMenu.h +61 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_Rhodes.h +16 -0
- data/platform/android/Rhodes/jni/include/jni/com_rhomobile_rhodes_alert_Alert.h +21 -0
- data/platform/android/Rhodes/jni/include/sslimpl.h +1 -1
- data/platform/android/Rhodes/jni/src/alert.cpp +32 -5
- data/platform/android/Rhodes/jni/src/callbacks.cpp +51 -21
- data/platform/android/Rhodes/jni/src/mapview.cpp +3 -8
- data/platform/android/Rhodes/jni/src/menu.cpp +70 -0
- data/platform/android/Rhodes/jni/src/navbar.cpp +16 -0
- data/platform/android/Rhodes/jni/src/rhodes.cpp +37 -0
- data/platform/android/Rhodes/jni/src/sslimpl.cpp +3 -3
- data/platform/android/Rhodes/jni/src/webview.cpp +21 -7
- data/platform/android/Rhodes/res/drawable/alert_alert.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_info.png +0 -0
- data/platform/android/Rhodes/res/drawable/alert_question.png +0 -0
- data/platform/android/Rhodes/res/drawable/camera.png +0 -0
- data/platform/android/Rhodes/res/layout/camera.xml +18 -3
- data/platform/android/Rhodes/res/menu/options.xml +0 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/AndroidR.java +5 -10
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Capabilities.java +12 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhoMenu.java +105 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/Rhodes.java +157 -122
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/SplashScreen.java +7 -58
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/WebView.java +16 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/alert/Alert.java +220 -17
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/Camera.java +22 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/camera/ImageCapture.java +44 -25
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocation.java +10 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/MainView.java +3 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SimpleMainView.java +10 -21
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/TabbedMainView.java +15 -12
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/phonebook/Phonebook.java +44 -0
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/socket/SSLImpl.java +47 -3
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/MailUriHandler.java +13 -6
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/TelUriHandler.java +11 -5
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/UriHandler.java +1 -4
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/uri/VideoUriHandler.java +61 -0
- data/platform/android/build/RhodesSRC_build.files +3 -0
- data/platform/android/build/android.rake +173 -60
- data/platform/android/build/androidcommon.rb +1 -2
- data/platform/android/build/librhocommon_build.files +5 -0
- data/platform/android/build/librhodes_build.files +2 -0
- data/platform/android/build/libruby_build.files +2 -1
- data/platform/bb/Hsqldb/Hsqldb.jdp +0 -3
- data/platform/bb/Hsqldb/src/com/rho/db/FileUtilBB.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBResult.java +16 -1
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBRowResult.java +5 -0
- data/platform/bb/Hsqldb/src/com/rho/db/HsqlDBStorage.java +25 -4
- data/platform/bb/Hsqldb/src/com/rho/db/Journal.java +1 -1
- data/platform/bb/Hsqldb/src/com/rho/file/FileAccessBB.java +0 -1
- data/platform/bb/Hsqldb/src/j2me/math/Number.java +6 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/CompiledStatementExecutor.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/Expression.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Parser.java +1 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Result.java +2 -0
- data/platform/bb/Hsqldb/src/org/hsqldb/Select.java +12 -6
- data/platform/bb/Hsqldb/src/org/hsqldb/Session.java +19 -12
- data/platform/bb/Hsqldb/src/org/hsqldb/Table.java +10 -4
- data/platform/bb/Hsqldb/src/org/hsqldb/Token.java +10 -2
- data/platform/bb/Hsqldb/src/org/hsqldb/Tokenizer.java +3 -3
- data/platform/bb/Hsqldb/src/org/hsqldb/lib/java/JavaSystem.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/HsqlProperties.java +2 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/persist/ScaledRAFile.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptReaderText.java +1 -1
- data/platform/bb/Hsqldb/src/org/hsqldb/scriptio/ScriptWriterBase.java +1 -1
- data/platform/bb/RubyVM/RubyVM.jdp +9 -10
- data/platform/bb/build/RubyVM_build.files +9 -7
- data/platform/bb/build/bb.rake +13 -3
- data/platform/bb/build/hsqldb_build.files +0 -2
- data/platform/bb/build/rhodes_build.files +5 -2
- data/platform/bb/rhodes/platform/4.7/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/BrowserAdapter5.java +154 -0
- data/platform/bb/rhodes/platform/5.0/com/rho/RhoMainScreen.java +8 -0
- data/platform/bb/rhodes/platform/common/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/rhodes.jdp +12 -7
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter.java +331 -0
- data/platform/bb/rhodes/src/com/rho/BrowserAdapter5.java +28 -0
- data/platform/bb/rhodes/src/com/rho/IBrowserAdapter.java +10 -0
- data/platform/bb/rhodes/src/com/rho/RhoMainScreen.java +4 -0
- data/platform/bb/rhodes/src/com/rho/RhoRubyHelper.java +2 -4
- data/platform/bb/rhodes/src/com/rho/{Jsr75File.java → file/Jsr75File.java} +83 -36
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/Jsr75RAFileImpl.java +0 -1
- data/platform/bb/{Hsqldb → rhodes}/src/com/rho/file/PersistRAFileImpl.java +0 -2
- data/platform/bb/rhodes/src/com/rho/net/NetworkAccess.java +8 -10
- data/platform/bb/rhodes/src/com/rho/rubyext/Alert.java +1 -1
- data/platform/bb/rhodes/src/com/rho/rubyext/GeoLocation.java +39 -0
- data/platform/bb/rhodes/src/com/rho/rubyext/System.java +63 -2
- data/platform/bb/rhodes/src/com/rho/rubyext/WebView.java +100 -0
- data/platform/bb/rhodes/src/rhomobile/LogScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/PushListeningThread.java +13 -1
- data/platform/bb/rhodes/src/rhomobile/RhodesApplication.java +138 -492
- data/platform/bb/rhodes/src/rhomobile/SecondaryResourceFetchThread.java +11 -2
- data/platform/bb/rhodes/src/rhomobile/Utilities.java +14 -10
- data/platform/bb/rhodes/src/rhomobile/camera/CameraScreen.java +5 -14
- data/platform/bb/rhodes/src/rhomobile/camera/ImageBrowserScreen.java +1 -1
- data/platform/bb/rhodes/src/rhomobile/mapview/GoogleMapField.java +2 -2
- data/platform/iphone/Classes/AppManager/AppManager.m +37 -14
- data/platform/iphone/Classes/Camera/PickImageDelegate.h +15 -4
- data/platform/iphone/Classes/Camera/PickImageDelegate.m +53 -50
- data/platform/iphone/Classes/DateTimePicker.h +17 -0
- data/platform/iphone/Classes/DateTimePicker.m +35 -0
- data/platform/iphone/Classes/GeoLocation/LocationController.m +2 -3
- data/platform/iphone/Classes/LogOptionsController.m +3 -2
- data/platform/iphone/Classes/LogViewController.m +4 -2
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +12 -20
- data/platform/iphone/Classes/MapView/MapAnnotation.h +9 -13
- data/platform/iphone/Classes/MapView/MapAnnotation.m +17 -65
- data/platform/iphone/Classes/MapView/MapViewController.h +1 -7
- data/platform/iphone/Classes/MapView/MapViewController.m +51 -25
- data/platform/iphone/Classes/NativeBar.h +0 -12
- data/platform/iphone/Classes/NativeBar.m +121 -2
- data/platform/iphone/Classes/NavBar.h +16 -0
- data/platform/iphone/Classes/NavBar.m +115 -0
- data/platform/iphone/Classes/RhoAlert.h +19 -0
- data/platform/iphone/Classes/RhoAlert.m +258 -0
- data/platform/iphone/Classes/RhoDelegate.m +1 -0
- data/platform/iphone/Classes/RhoMainView.h +33 -0
- data/platform/iphone/Classes/Rhodes.h +56 -0
- data/platform/iphone/Classes/Rhodes.m +533 -0
- data/platform/iphone/Classes/RingtoneManager.h +17 -0
- data/platform/iphone/Classes/RingtoneManager.m +73 -0
- data/platform/iphone/Classes/SimpleMainView.h +30 -0
- data/platform/iphone/Classes/SimpleMainView.m +380 -0
- data/platform/iphone/Classes/TabbedMainView.h +24 -0
- data/platform/iphone/Classes/TabbedMainView.m +202 -0
- data/platform/iphone/Classes/WebView.m +123 -0
- data/platform/iphone/Classes/rho/net/NetRequestImpl.m +2 -2
- data/platform/iphone/Classes/rho/net/sslimpl.cpp +13 -1
- data/platform/iphone/Classes/rho/net/sslimpl.h +1 -1
- data/platform/iphone/Info.plist +1 -1
- data/platform/iphone/RhoLib/RhoLib.xcodeproj/project.pbxproj +44 -0
- data/platform/iphone/main.m +1 -2
- data/platform/iphone/rbuild/iphone.rake +8 -16
- data/platform/iphone/rhoextlib/dosyscall.c +1 -1
- data/platform/iphone/rhoextlib/rhoextlib.xcodeproj/project.pbxproj +6 -4
- data/platform/iphone/rhorubylib/rhorubylib.xcodeproj/project.pbxproj +12 -0
- data/platform/iphone/rhorunner.xcodeproj/project.pbxproj +97 -62
- data/platform/iphone/rhosynclib/rhosynclib.xcodeproj/project.pbxproj +12 -0
- data/platform/osx/Rhodes Launcher/launch.rb +14 -21
- data/platform/shared/common/AppMenu.cpp +122 -0
- data/platform/shared/common/AppMenu.h +46 -0
- data/platform/shared/common/PosixThreadImpl.cpp +1 -1
- data/platform/shared/common/RhoConf.cpp +27 -2
- data/platform/shared/common/RhoConf.h +5 -0
- data/platform/shared/common/RhoFilePath.h +21 -0
- data/platform/shared/common/RhoStd.h +44 -5
- data/platform/shared/common/RhoTime.h +20 -7
- data/platform/shared/common/RhodesApp.cpp +236 -177
- data/platform/shared/common/RhodesApp.h +36 -13
- data/platform/shared/common/SplashScreen.cpp +2 -2
- data/platform/shared/common/StringConverter.h +10 -11
- data/platform/shared/common/rhoparams.c +0 -6
- data/platform/shared/curl/lib/rhossl.c +3 -2
- data/platform/shared/curl/lib/url.c +0 -5
- data/platform/shared/db/DBAdapter.cpp +304 -81
- data/platform/shared/db/DBAdapter.h +24 -7
- data/platform/shared/db/DBAttrManager.cpp +83 -30
- data/platform/shared/db/DBAttrManager.h +6 -0
- data/platform/shared/db/DBResult.h +15 -4
- data/platform/shared/json/JSONIterator.cpp +100 -3
- data/platform/shared/json/JSONIterator.h +28 -3
- data/platform/shared/net/AsyncHttp.cpp +25 -22
- data/platform/shared/net/AsyncHttp.h +10 -6
- data/platform/shared/net/CURLNetRequest.cpp +115 -36
- data/platform/shared/net/CURLNetRequest.h +6 -0
- data/platform/shared/net/HttpServer.cpp +6 -4
- data/platform/shared/net/HttpServer.h +0 -1
- data/platform/shared/net/INetRequest.h +19 -3
- data/platform/shared/net/URI.cpp +2 -2
- data/platform/shared/net/ssl.cpp +2 -2
- data/platform/shared/net/ssl.h +2 -2
- data/platform/shared/ruby/ext/alert/alert.i +14 -2
- data/platform/shared/ruby/ext/alert/alert_wrap.c +40 -20
- data/platform/shared/ruby/ext/asynchttp/asynchttp.i +8 -8
- data/platform/shared/ruby/ext/asynchttp/asynchttp_wrap.c +112 -16
- data/platform/shared/ruby/ext/geolocation/geolocation.i +16 -12
- data/platform/shared/ruby/ext/geolocation/geolocation_wrap.c +481 -125
- data/platform/shared/ruby/ext/navbar/navbar.i +20 -0
- data/platform/shared/ruby/ext/navbar/navbar_wrap.c +1859 -0
- data/platform/shared/ruby/ext/rho/extensions.c +1 -1
- data/platform/shared/ruby/ext/rho/rhoruby.c +32 -2
- data/platform/shared/ruby/ext/rho/rhoruby.h +7 -2
- data/platform/shared/ruby/ext/rhoconf/rhoconf.i +4 -0
- data/platform/shared/ruby/ext/rhoconf/rhoconf_wrap.c +31 -0
- data/platform/shared/ruby/ext/sqlite3_api/sqlite3_api_wrap.c +188 -3226
- data/platform/shared/ruby/ext/syncengine/syncengine.i +14 -25
- data/platform/shared/ruby/ext/syncengine/syncengine_wrap.c +96 -104
- data/platform/shared/ruby/ext/system/system.i +12 -0
- data/platform/shared/ruby/ext/system/system_wrap.c +101 -7
- data/platform/shared/ruby/ext/webview/webview.i +20 -15
- data/platform/shared/ruby/ext/webview/webview_wrap.c +42 -16
- data/platform/shared/ruby/thread_pthread.c +4 -4
- data/platform/shared/ruby/thread_win32.c +4 -4
- data/platform/shared/ruby/wince/io_wce.c +0 -1
- data/platform/shared/rubyJVM/src/com/rho/FilePath.java +18 -2
- data/platform/shared/rubyJVM/src/com/rho/IRhoRubyHelper.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/Properties.java +9 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoClassFactory.java +2 -3
- data/platform/shared/rubyJVM/src/com/rho/RhoConf.java +47 -8
- data/platform/shared/rubyJVM/src/com/rho/RhoLogConf.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoLogFileSink.java +1 -0
- data/platform/shared/rubyJVM/src/com/rho/RhoRuby.java +43 -5
- data/platform/shared/rubyJVM/src/com/rho/RhodesApp.java +98 -3
- data/platform/shared/rubyJVM/src/com/rho/db/DBAdapter.java +460 -175
- data/platform/shared/rubyJVM/src/com/rho/db/DBAttrManager.java +81 -33
- data/platform/shared/rubyJVM/src/com/rho/db/IDBCallback.java +3 -5
- data/platform/shared/rubyJVM/src/com/rho/db/IDBResult.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/db/IDBStorage.java +2 -0
- data/platform/shared/rubyJVM/src/com/rho/{IFile.java → file/IFile.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IFileAccess.java → file/IFileAccess.java} +1 -1
- data/platform/shared/rubyJVM/src/com/rho/{IRAFile.java → file/IRAFile.java} +1 -1
- data/platform/{bb/Hsqldb/src/com/rho/db → shared/rubyJVM/src/com/rho/file}/RandomAccessFile.java +1 -2
- data/platform/shared/rubyJVM/src/com/rho/{SimpleFile.java → file/SimpleFile.java} +5 -1
- data/platform/shared/rubyJVM/src/com/rho/net/AsyncHttp.java +23 -18
- data/platform/shared/rubyJVM/src/com/rho/net/NetRequest.java +167 -250
- data/platform/shared/rubyJVM/src/com/rho/net/RhoConnection.java +100 -30
- data/platform/shared/rubyJVM/src/com/rho/net/URI.java +0 -1
- data/platform/shared/rubyJVM/src/com/rho/sync/ClientRegister.java +30 -33
- data/platform/shared/rubyJVM/src/com/rho/sync/ISyncProtocol.java +20 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONEntry.java +5 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/JSONStructIterator.java +74 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncEngine.java +486 -257
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncNotify.java +89 -58
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncProtocol_3.java +79 -0
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncSource.java +634 -495
- data/platform/shared/rubyJVM/src/com/rho/sync/SyncThread.java +74 -90
- data/platform/shared/rubyJVM/src/com/xruby/GeneratedMethods/RubySymbol_Methods.java +1 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/builtin/RubyThread.java +6 -0
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyRuntime.java +6 -2
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubySymbol.java +17 -1
- data/platform/shared/rubyJVM/src/com/xruby/runtime/lang/RubyValue.java +1 -0
- data/platform/shared/rubyJVM/src/org/json/me/JSONObject.java +3 -0
- data/platform/shared/rubyext/GeoLocation.cpp +23 -0
- data/platform/shared/rubyext/GeoLocation.h +2 -0
- data/platform/shared/rubyext/RhoRuby.cpp +31 -0
- data/platform/shared/rubyext/RhoRuby.h +32 -0
- data/platform/shared/rubyext/System.cpp +14 -3
- data/platform/shared/rubyext/WebView.h +21 -0
- data/platform/shared/sync/ClientRegister.cpp +23 -28
- data/platform/shared/sync/ClientRegister.h +6 -2
- data/platform/shared/sync/ISyncProtocol.h +29 -0
- data/platform/shared/sync/SyncEngine.cpp +450 -190
- data/platform/shared/sync/SyncEngine.h +28 -38
- data/platform/shared/sync/SyncNotify.cpp +43 -41
- data/platform/shared/sync/SyncNotify.h +7 -7
- data/platform/shared/sync/SyncProtocol_3.h +86 -0
- data/platform/shared/sync/SyncSource.cpp +535 -371
- data/platform/shared/sync/SyncSource.h +48 -55
- data/platform/shared/sync/SyncThread.cpp +59 -103
- data/platform/shared/sync/SyncThread.h +10 -23
- data/platform/shared/unzip/unzip.cpp +3 -2
- data/platform/shared/unzip/unzip.h +5 -1
- data/platform/shared/wtl80/include/atlapp.h +10 -10
- data/platform/wm/RhoLib/RhoLib.vcproj +32 -0
- data/platform/wm/build/build_inf.js +40 -3
- data/platform/wm/build/wm.rake +95 -9
- data/platform/wm/rhodes/Alert.cpp +4 -0
- data/platform/wm/rhodes/DateTimePicker.cpp +183 -0
- data/platform/wm/rhodes/DateTimePicker.h +100 -0
- data/platform/wm/rhodes/MainWindow.cpp +222 -209
- data/platform/wm/rhodes/MainWindow.h +28 -35
- data/platform/wm/rhodes/Rhodes.cpp +20 -60
- data/platform/wm/rhodes/Rhodes.rc +41 -7
- data/platform/wm/rhodes/Utils.cpp +65 -0
- data/platform/wm/rhodes/Utils.h +9 -0
- data/platform/wm/rhodes/camera/Camera.cpp +2 -2
- data/platform/wm/rhodes/menubar.cpp +2 -33
- data/platform/wm/rhodes/menubar.h +0 -14
- data/platform/wm/rhodes/resource.h +13 -11
- data/platform/wm/rhodes/rho/net/NetRequest.cpp +16 -35
- data/platform/wm/rhodes/rho/net/NetRequest.h +8 -2
- data/platform/wm/rhodes/rho/net/NetRequestImpl.cpp +264 -46
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +14 -4
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.cpp +1 -1
- data/platform/wm/rhodes/rho/rubyext/GeoLocationImpl.h +1 -1
- data/platform/wm/rhodes/rho/rubyext/SystemImpl.cpp +77 -4
- data/platform/wm/rhodes/rho/rubyext/WebView.cpp +63 -0
- data/platform/wm/rhodes/rhodes.vcproj +20 -66
- data/platform/wm/rhodes/stdafx.h +22 -0
- data/platform/wm/rubylib/rubylib.vcproj +4 -0
- data/platform/wm/syncengine/syncengine.vcproj +8 -0
- data/platform/wm/tools/detool.sln +66 -0
- data/platform/wm/tools/detool/DEMComInterface.tlb +0 -0
- data/platform/wm/tools/detool/ReadMe.txt +33 -0
- data/platform/wm/tools/detool/detool.cpp +559 -0
- data/platform/wm/tools/detool/detool.h +5 -0
- data/platform/wm/tools/detool/detool.vcproj +233 -0
- data/platform/wm/tools/detool/stdafx.cpp +8 -0
- data/platform/wm/tools/detool/stdafx.h +15 -0
- data/platform/wm/tools/detool/targetver.h +24 -0
- data/platform/wm/tools/rhosetup/ReadMe.txt +41 -0
- data/platform/wm/tools/rhosetup/rhosetup.cpp +52 -0
- data/platform/wm/tools/rhosetup/rhosetup.vcproj +641 -0
- data/platform/wm/tools/rhosetup/stdafx.cpp +8 -0
- data/platform/wm/tools/rhosetup/stdafx.h +59 -0
- data/rakefile.rb +33 -10
- data/res/build-tools/db/syncdb.schema +25 -23
- data/res/build-tools/db/syncdb.triggers +1 -1
- data/res/build-tools/detool.exe +0 -0
- data/res/build-tools/rhosetup.dll +0 -0
- data/res/generators/rhogen.rb +27 -22
- data/res/generators/templates/application/app/Settings/controller.rb +3 -1
- data/res/generators/templates/application/app/Settings/home.bb.erb +17 -0
- data/res/generators/templates/application/app/Settings/home.erb +21 -12
- data/res/generators/templates/application/app/Settings/index.bb.erb +32 -0
- data/res/generators/templates/application/app/Settings/index.erb +44 -15
- data/res/generators/templates/application/app/Settings/login.bb.erb +35 -0
- data/res/generators/templates/application/app/Settings/login.erb +29 -30
- data/res/generators/templates/application/app/Settings/reset.bb.erb +15 -0
- data/res/generators/templates/application/app/Settings/reset.erb +16 -13
- data/res/generators/templates/application/app/Settings/wait.bb.erb +3 -0
- data/res/generators/templates/application/app/Settings/wait.erb +4 -4
- data/res/generators/templates/application/app/application.rb +8 -0
- data/res/generators/templates/application/app/helpers/browser_helper.rb +13 -0
- data/res/generators/templates/application/app/index.bb.erb +26 -0
- data/res/generators/templates/application/app/index.erb +21 -12
- data/res/generators/templates/application/app/layout.erb +9 -11
- data/res/generators/templates/application/public/css/android.css +285 -0
- data/res/generators/templates/application/public/css/blackberry.css +85 -78
- data/res/generators/templates/application/public/css/iphone.css +286 -296
- data/res/generators/templates/application/public/css/webkit.css +34 -0
- data/res/generators/templates/application/public/css/windows_mobile.css +208 -0
- data/res/generators/templates/application/public/icons/Read me first - license.txt +14 -0
- data/res/generators/templates/application/public/icons/about.png +0 -0
- data/res/generators/templates/application/public/icons/airplane.png +0 -0
- data/res/generators/templates/application/public/icons/baby.png +0 -0
- data/res/generators/templates/application/public/icons/badge.png +0 -0
- data/res/generators/templates/application/public/icons/bandaid.png +0 -0
- data/res/generators/templates/application/public/icons/bar-chart.png +0 -0
- data/res/generators/templates/application/public/icons/battery.png +0 -0
- data/res/generators/templates/application/public/icons/beaker.png +0 -0
- data/res/generators/templates/application/public/icons/beaker2.png +0 -0
- data/res/generators/templates/application/public/icons/beermug.png +0 -0
- data/res/generators/templates/application/public/icons/bird.png +0 -0
- data/res/generators/templates/application/public/icons/book.png +0 -0
- data/res/generators/templates/application/public/icons/bookmark.png +0 -0
- data/res/generators/templates/application/public/icons/brightness.png +0 -0
- data/res/generators/templates/application/public/icons/bug.png +0 -0
- data/res/generators/templates/application/public/icons/cabinet.png +0 -0
- data/res/generators/templates/application/public/icons/calendar.png +0 -0
- data/res/generators/templates/application/public/icons/camera.png +0 -0
- data/res/generators/templates/application/public/icons/changeName.rb +22 -0
- data/res/generators/templates/application/public/icons/chat2.png +0 -0
- data/res/generators/templates/application/public/icons/chicken.png +0 -0
- data/res/generators/templates/application/public/icons/clock.png +0 -0
- data/res/generators/templates/application/public/icons/cloud.png +0 -0
- data/res/generators/templates/application/public/icons/coffee.png +0 -0
- data/res/generators/templates/application/public/icons/compass.png +0 -0
- data/res/generators/templates/application/public/icons/contrast.png +0 -0
- data/res/generators/templates/application/public/icons/dashboard.png +0 -0
- data/res/generators/templates/application/public/icons/display.png +0 -0
- data/res/generators/templates/application/public/icons/dogpaw.png +0 -0
- data/res/generators/templates/application/public/icons/download.png +0 -0
- data/res/generators/templates/application/public/icons/dumbbell.png +0 -0
- data/res/generators/templates/application/public/icons/ekg.png +0 -0
- data/res/generators/templates/application/public/icons/envelope.png +0 -0
- data/res/generators/templates/application/public/icons/equalizer.png +0 -0
- data/res/generators/templates/application/public/icons/eye.png +0 -0
- data/res/generators/templates/application/public/icons/film-roll.png +0 -0
- data/res/generators/templates/application/public/icons/flag.png +0 -0
- data/res/generators/templates/application/public/icons/fork-and-knife.png +0 -0
- data/res/generators/templates/application/public/icons/fuel.png +0 -0
- data/res/generators/templates/application/public/icons/gameplan.png +0 -0
- data/res/generators/templates/application/public/icons/gear.png +0 -0
- data/res/generators/templates/application/public/icons/gear2.png +0 -0
- data/res/generators/templates/application/public/icons/gift.png +0 -0
- data/res/generators/templates/application/public/icons/heart.png +0 -0
- data/res/generators/templates/application/public/icons/house.png +0 -0
- data/res/generators/templates/application/public/icons/inbox.png +0 -0
- data/res/generators/templates/application/public/icons/index-cards.png +0 -0
- data/res/generators/templates/application/public/icons/iphone.png +0 -0
- data/res/generators/templates/application/public/icons/ipod.png +0 -0
- data/res/generators/templates/application/public/icons/key.png +0 -0
- data/res/generators/templates/application/public/icons/lifebuoy.png +0 -0
- data/res/generators/templates/application/public/icons/lightbulb.png +0 -0
- data/res/generators/templates/application/public/icons/line-chart.png +0 -0
- data/res/generators/templates/application/public/icons/location.png +0 -0
- data/res/generators/templates/application/public/icons/lock.png +0 -0
- data/res/generators/templates/application/public/icons/loopback.png +0 -0
- data/res/generators/templates/application/public/icons/magnifying-glass.png +0 -0
- data/res/generators/templates/application/public/icons/map-marker.png +0 -0
- data/res/generators/templates/application/public/icons/map.png +0 -0
- data/res/generators/templates/application/public/icons/medical-bag.png +0 -0
- data/res/generators/templates/application/public/icons/medical.png +0 -0
- data/res/generators/templates/application/public/icons/microphone.png +0 -0
- data/res/generators/templates/application/public/icons/movie1.png +0 -0
- data/res/generators/templates/application/public/icons/movie2.png +0 -0
- data/res/generators/templates/application/public/icons/network.png +0 -0
- data/res/generators/templates/application/public/icons/note.png +0 -0
- data/res/generators/templates/application/public/icons/outlet.png +0 -0
- data/res/generators/templates/application/public/icons/palette.png +0 -0
- data/res/generators/templates/application/public/icons/paperclip.png +0 -0
- data/res/generators/templates/application/public/icons/phone.png +0 -0
- data/res/generators/templates/application/public/icons/photos.png +0 -0
- data/res/generators/templates/application/public/icons/piano.png +0 -0
- data/res/generators/templates/application/public/icons/picture-frame.png +0 -0
- data/res/generators/templates/application/public/icons/pill.png +0 -0
- data/res/generators/templates/application/public/icons/pin.png +0 -0
- data/res/generators/templates/application/public/icons/pinetree.png +0 -0
- data/res/generators/templates/application/public/icons/planet.png +0 -0
- data/res/generators/templates/application/public/icons/puzzle.png +0 -0
- data/res/generators/templates/application/public/icons/radar.png +0 -0
- data/res/generators/templates/application/public/icons/redo.png +0 -0
- data/res/generators/templates/application/public/icons/refresh.png +0 -0
- data/res/generators/templates/application/public/icons/runner.png +0 -0
- data/res/generators/templates/application/public/icons/shoebox.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-bag.png +0 -0
- data/res/generators/templates/application/public/icons/shopping-cart.png +0 -0
- data/res/generators/templates/application/public/icons/shuffle.png +0 -0
- data/res/generators/templates/application/public/icons/signpost.png +0 -0
- data/res/generators/templates/application/public/icons/skull-n-crossbones.png +0 -0
- data/res/generators/templates/application/public/icons/skull.png +0 -0
- data/res/generators/templates/application/public/icons/sliders.png +0 -0
- data/res/generators/templates/application/public/icons/spraycan.png +0 -0
- data/res/generators/templates/application/public/icons/squiggle.png +0 -0
- data/res/generators/templates/application/public/icons/star.png +0 -0
- data/res/generators/templates/application/public/icons/stopwatch.png +0 -0
- data/res/generators/templates/application/public/icons/suitcase.png +0 -0
- data/res/generators/templates/application/public/icons/tag.png +0 -0
- data/res/generators/templates/application/public/icons/tags.png +0 -0
- data/res/generators/templates/application/public/icons/target.png +0 -0
- data/res/generators/templates/application/public/icons/testtube.png +0 -0
- data/res/generators/templates/application/public/icons/thermometer.png +0 -0
- data/res/generators/templates/application/public/icons/toolbox.png +0 -0
- data/res/generators/templates/application/public/icons/trophy.png +0 -0
- data/res/generators/templates/application/public/icons/tshirt.png +0 -0
- data/res/generators/templates/application/public/icons/tv.png +0 -0
- data/res/generators/templates/application/public/icons/umbrella.png +0 -0
- data/res/generators/templates/application/public/icons/walk.png +0 -0
- data/res/generators/templates/application/public/icons/weather.png +0 -0
- data/res/generators/templates/application/public/icons/widescreen.png +0 -0
- data/res/generators/templates/application/public/icons/wineglass.png +0 -0
- data/res/generators/templates/application/public/icons/zap.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_check_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_check_on.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_off.png +0 -0
- data/res/generators/templates/application/public/images/android/btn_radio_on.png +0 -0
- data/res/generators/templates/application/public/images/android/ic_menu_more.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure.png +0 -0
- data/res/generators/templates/application/public/images/iphone/disclosure_detail.png +0 -0
- data/res/generators/templates/application/public/images/iphone/radiobutton.png +0 -0
- data/res/generators/templates/application/public/images/iphone/select.png +0 -0
- data/res/generators/templates/application/public/images/iphone/switch.png +0 -0
- data/res/generators/templates/application/public/images/listArrow.png +0 -0
- data/res/generators/templates/application/public/images/listArrowDown.png +0 -0
- data/res/generators/templates/model/controller.rb +2 -0
- data/res/generators/templates/model/edit.bb.erb +24 -0
- data/res/generators/templates/model/edit.erb +21 -25
- data/res/generators/templates/model/index.bb.erb +21 -0
- data/res/generators/templates/model/index.erb +28 -14
- data/res/generators/templates/model/new.bb.erb +24 -0
- data/res/generators/templates/model/new.erb +20 -20
- data/res/generators/templates/model/show.bb.erb +21 -0
- data/res/generators/templates/model/show.erb +15 -15
- data/rhobuild.yml +37 -0
- data/rhodes.gemspec +1 -1
- data/spec/framework_spec/app/Account/config.rb +57 -1
- data/spec/framework_spec/app/Case/config.rb +1 -1
- data/spec/framework_spec/app/Customer/config.rb +1 -1
- data/spec/framework_spec/app/Product/config.rb +15 -1
- data/spec/framework_spec/app/spec/fixtures/object_values.txt +90 -90
- data/spec/framework_spec/app/spec/pagination/fixtures/object_values.txt +91 -91
- data/spec/framework_spec/app/spec/rho_spec.rb +1 -1
- data/spec/framework_spec/app/spec/rhom_object_spec.rb +47 -28
- data/spec/framework_spec/app/spec/rhom_spec.rb +8 -8
- data/spec/framework_spec/app/spec/spec_helper.rb +13 -5
- data/spec/framework_spec/app/spec_runner.rb +5 -4
- data/spec/framework_spec/public/css/base.css +0 -1
- data/spec/framework_spec/public/css/iphone.css +0 -1
- data/spec/framework_spec/rhoconfig.txt +3 -1
- metadata +220 -37
- data/platform/bb/rhodes/src/rhomobile/WebView.java +0 -90
- data/platform/iphone/Classes/BarItem.h +0 -27
- data/platform/iphone/Classes/BarItem.m +0 -32
- data/platform/iphone/Classes/JSString.h +0 -12
- data/platform/iphone/Classes/JSString.m +0 -7
- data/platform/iphone/Classes/RhoRunnerAppDelegate.h +0 -48
- data/platform/iphone/Classes/RhoRunnerAppDelegate.m +0 -617
- data/platform/iphone/Classes/Server/ServerHost.h +0 -81
- data/platform/iphone/Classes/Server/ServerHost.m +0 -597
- data/platform/iphone/Classes/Server/WebViewUrl.h +0 -13
- data/platform/iphone/Classes/Server/WebViewUrl.m +0 -8
- data/platform/iphone/Classes/TabBarDelegate.h +0 -39
- data/platform/iphone/Classes/TabBarDelegate.m +0 -151
- data/platform/iphone/Classes/Utils/unzip.cpp +0 -4328
- data/platform/iphone/Classes/Utils/unzip.h +0 -234
- data/platform/iphone/Classes/WebViewController.h +0 -59
- data/platform/iphone/Classes/WebViewController.m +0 -472
- data/platform/wm/rhodes/GetURLDialog.cpp +0 -64
- data/platform/wm/rhodes/GetURLDialog.h +0 -39
- data/res/generators/templates/application/public/css/base.css +0 -39
- data/res/generators/templates/application/public/css/rho.css +0 -3
- data/res/generators/templates/application/public/css/xhtml.css +0 -114
- data/spec/framework_spec/app/Question/config.rb +0 -3
- data/spec/generator_spec/source_generator_spec.rb +0 -27
@@ -0,0 +1,183 @@
|
|
1
|
+
#include "stdafx.h"
|
2
|
+
#include "logging/RhoLog.h"
|
3
|
+
|
4
|
+
#include "MainWindow.h"
|
5
|
+
#include "Utils.h"
|
6
|
+
#include "DateTimePicker.h"
|
7
|
+
|
8
|
+
#define DLG_ITEM_SET_FONT_BOLD(ITEM_ID) \
|
9
|
+
{ \
|
10
|
+
HFONT hFont = GetDlgItem((ITEM_ID)).GetFont(); \
|
11
|
+
LOGFONT fontAttributes = { 0 }; \
|
12
|
+
::GetObject(hFont, sizeof(fontAttributes), &fontAttributes);\
|
13
|
+
fontAttributes.lfWeight = FW_BOLD; \
|
14
|
+
hFont = CreateFontIndirect(&fontAttributes); \
|
15
|
+
GetDlgItem((ITEM_ID)).SetFont(hFont); \
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
/*
|
20
|
+
* TODO: title and initial time, flexible behavour
|
21
|
+
*/
|
22
|
+
|
23
|
+
extern "C" HWND getMainWnd();
|
24
|
+
|
25
|
+
CDateTimePickerDialog::CDateTimePickerDialog (const CDateTimeMessage *msg)
|
26
|
+
{
|
27
|
+
m_returnTime = 0;
|
28
|
+
m_format = msg->m_format;
|
29
|
+
m_title = msg->m_title;
|
30
|
+
m_initialTime = msg->m_initialTime;
|
31
|
+
}
|
32
|
+
|
33
|
+
CDateTimePickerDialog::~CDateTimePickerDialog ()
|
34
|
+
{
|
35
|
+
}
|
36
|
+
|
37
|
+
LRESULT CDateTimePickerDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
38
|
+
{
|
39
|
+
#if defined(_WIN32_WCE)
|
40
|
+
//USES_CONVERSION;
|
41
|
+
SetWindowText(_T("Date"));
|
42
|
+
|
43
|
+
SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN };
|
44
|
+
RHO_ASSERT(SHInitDialog(&shidi));
|
45
|
+
|
46
|
+
|
47
|
+
SHMENUBARINFO mbi = { sizeof(mbi), 0 };
|
48
|
+
mbi.hwndParent = m_hWnd;
|
49
|
+
mbi.nToolBarId = IDR_GETURL_MENUBAR;
|
50
|
+
mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
|
51
|
+
RHO_ASSERT(SHCreateMenuBar(&mbi));
|
52
|
+
|
53
|
+
DLG_ITEM_SET_FONT_BOLD (IDC_DATE_STATIC);
|
54
|
+
DLG_ITEM_SET_FONT_BOLD (IDC_TIME_STATIC);
|
55
|
+
|
56
|
+
if (m_format == CDateTimeMessage::FORMAT_DATE) {
|
57
|
+
GetDlgItem(IDC_TIME_CTRL).ShowWindow(SW_HIDE);
|
58
|
+
GetDlgItem(IDC_TIME_STATIC).ShowWindow(SW_HIDE);
|
59
|
+
}
|
60
|
+
|
61
|
+
GotoDlgCtrl(GetDlgItem(IDC_DATE_CTRL));
|
62
|
+
#endif
|
63
|
+
|
64
|
+
return FALSE;
|
65
|
+
}
|
66
|
+
|
67
|
+
LRESULT CDateTimePickerDialog::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND hwnd, BOOL& /*bHandled*/)
|
68
|
+
{
|
69
|
+
SYSTEMTIME sysTime;
|
70
|
+
|
71
|
+
if (m_format == CDateTimeMessage::FORMAT_TIME)
|
72
|
+
{
|
73
|
+
DateTime_GetSystemtime (GetDlgItem(IDC_TIME_CTRL), &sysTime);
|
74
|
+
}
|
75
|
+
else if (m_format == CDateTimeMessage::FORMAT_DATE)
|
76
|
+
{
|
77
|
+
DateTime_GetSystemtime (GetDlgItem(IDC_DATE_CTRL), &sysTime);
|
78
|
+
}
|
79
|
+
else if (m_format == CDateTimeMessage::FORMAT_DATE_TIME)
|
80
|
+
{
|
81
|
+
SYSTEMTIME time, date;
|
82
|
+
|
83
|
+
DateTime_GetSystemtime (GetDlgItem(IDC_TIME_CTRL), &time);
|
84
|
+
DateTime_GetSystemtime (GetDlgItem(IDC_DATE_CTRL), &date);
|
85
|
+
|
86
|
+
sysTime.wYear = date.wYear;
|
87
|
+
sysTime.wMonth = date.wMonth;
|
88
|
+
sysTime.wDayOfWeek = date.wDayOfWeek;
|
89
|
+
sysTime.wDay = date.wDay;
|
90
|
+
sysTime.wHour = time.wHour;
|
91
|
+
sysTime.wMinute = time.wMinute;
|
92
|
+
sysTime.wSecond = time.wSecond;
|
93
|
+
}
|
94
|
+
else
|
95
|
+
{
|
96
|
+
LOG(ERROR) + "invalid format";
|
97
|
+
m_returnTime = 0;
|
98
|
+
}
|
99
|
+
|
100
|
+
m_returnTime = SystemTimeToUnixTime (&sysTime);
|
101
|
+
|
102
|
+
EndDialog(wID);
|
103
|
+
return 0;
|
104
|
+
}
|
105
|
+
|
106
|
+
time_t CDateTimePickerDialog::GetTime()
|
107
|
+
{
|
108
|
+
return m_returnTime;
|
109
|
+
}
|
110
|
+
|
111
|
+
LRESULT CDateTimePickerDialog::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
112
|
+
{
|
113
|
+
EndDialog(wID);
|
114
|
+
return 0;
|
115
|
+
}
|
116
|
+
|
117
|
+
|
118
|
+
CTimePickerDialog::CTimePickerDialog (const CDateTimeMessage *msg)
|
119
|
+
{
|
120
|
+
m_returnTime = 0;
|
121
|
+
m_format = msg->m_format;
|
122
|
+
m_title = msg->m_title;
|
123
|
+
m_initialTime = msg->m_initialTime;
|
124
|
+
}
|
125
|
+
|
126
|
+
CTimePickerDialog::~CTimePickerDialog ()
|
127
|
+
{
|
128
|
+
}
|
129
|
+
|
130
|
+
LRESULT CTimePickerDialog::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
131
|
+
{
|
132
|
+
#if defined(_WIN32_WCE)
|
133
|
+
//USES_CONVERSION;
|
134
|
+
SetWindowText(_T("Date"));
|
135
|
+
|
136
|
+
SHINITDLGINFO shidi = { SHIDIM_FLAGS, m_hWnd, SHIDIF_SIZEDLGFULLSCREEN };
|
137
|
+
RHO_ASSERT(SHInitDialog(&shidi));
|
138
|
+
|
139
|
+
|
140
|
+
SHMENUBARINFO mbi = { sizeof(mbi), 0 };
|
141
|
+
mbi.hwndParent = m_hWnd;
|
142
|
+
mbi.nToolBarId = IDR_GETURL_MENUBAR;
|
143
|
+
mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
|
144
|
+
RHO_ASSERT(SHCreateMenuBar(&mbi));
|
145
|
+
|
146
|
+
DLG_ITEM_SET_FONT_BOLD (IDC_TIME_STATIC);
|
147
|
+
|
148
|
+
GotoDlgCtrl(GetDlgItem(IDC_TIME_CTRL));
|
149
|
+
#endif
|
150
|
+
|
151
|
+
return FALSE;
|
152
|
+
}
|
153
|
+
|
154
|
+
LRESULT CTimePickerDialog::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND hwnd, BOOL& /*bHandled*/)
|
155
|
+
{
|
156
|
+
SYSTEMTIME sysTime;
|
157
|
+
DateTime_GetSystemtime (GetDlgItem(IDC_TIME_CTRL), &sysTime);
|
158
|
+
m_returnTime = SystemTimeToUnixTime (&sysTime);
|
159
|
+
|
160
|
+
EndDialog(wID);
|
161
|
+
return 0;
|
162
|
+
}
|
163
|
+
|
164
|
+
time_t CTimePickerDialog::GetTime()
|
165
|
+
{
|
166
|
+
return m_returnTime;
|
167
|
+
}
|
168
|
+
|
169
|
+
LRESULT CTimePickerDialog::OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
170
|
+
{
|
171
|
+
EndDialog(wID);
|
172
|
+
return 0;
|
173
|
+
}
|
174
|
+
|
175
|
+
void choose_datetime(char* callback, char* title,
|
176
|
+
long initial_time, int format, char* data)
|
177
|
+
{
|
178
|
+
LOG(INFO) + __FUNCTION__ + "callback = " + callback + " title = " + title;
|
179
|
+
|
180
|
+
HWND main_wnd = getMainWnd();
|
181
|
+
::PostMessage(main_wnd, WM_DATETIME_PICKER, 0,
|
182
|
+
(LPARAM)new CDateTimeMessage(callback, title, initial_time, format, data));
|
183
|
+
}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
#ifndef __DATETIMEPICKER_H__
|
2
|
+
#define __DATETIMEPICKER_H__
|
3
|
+
|
4
|
+
#include "resource.h"
|
5
|
+
|
6
|
+
//TODO: delegates
|
7
|
+
class CDateTimeMessage
|
8
|
+
{
|
9
|
+
public:
|
10
|
+
static enum
|
11
|
+
{
|
12
|
+
FORMAT_DATE_TIME,
|
13
|
+
FORMAT_DATE,
|
14
|
+
FORMAT_TIME
|
15
|
+
};
|
16
|
+
|
17
|
+
CDateTimeMessage (const char* callback, const char* title, long initial_time, int format, const char* data)
|
18
|
+
{
|
19
|
+
m_callback = strdup (callback);
|
20
|
+
m_title = strdup (title);
|
21
|
+
m_initialTime = initial_time;
|
22
|
+
m_format = format;
|
23
|
+
m_data = strdup (data);
|
24
|
+
}
|
25
|
+
|
26
|
+
~CDateTimeMessage ()
|
27
|
+
{
|
28
|
+
free (m_callback);
|
29
|
+
free (m_title);
|
30
|
+
free (m_data);
|
31
|
+
}
|
32
|
+
|
33
|
+
char *m_callback;
|
34
|
+
char *m_title;
|
35
|
+
char *m_data;
|
36
|
+
long m_initialTime;
|
37
|
+
int m_format;
|
38
|
+
};
|
39
|
+
|
40
|
+
class CDateTimePickerDialog : public CDialogImpl<CDateTimePickerDialog>
|
41
|
+
{
|
42
|
+
public:
|
43
|
+
CDateTimePickerDialog (const CDateTimeMessage *msg);
|
44
|
+
~CDateTimePickerDialog ();
|
45
|
+
|
46
|
+
time_t GetTime();
|
47
|
+
|
48
|
+
enum { IDD = IDD_DATETIME_PICKER };
|
49
|
+
|
50
|
+
BEGIN_MSG_MAP(CDateTimePickerDialog)
|
51
|
+
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
52
|
+
COMMAND_ID_HANDLER(IDOK, OnOK)
|
53
|
+
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
|
54
|
+
END_MSG_MAP()
|
55
|
+
|
56
|
+
private:
|
57
|
+
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
58
|
+
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
59
|
+
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
60
|
+
|
61
|
+
private:
|
62
|
+
int m_format;
|
63
|
+
time_t m_returnTime;
|
64
|
+
time_t m_initialTime;
|
65
|
+
const char *m_title;
|
66
|
+
};
|
67
|
+
|
68
|
+
class CTimePickerDialog : public CDialogImpl<CTimePickerDialog>
|
69
|
+
{
|
70
|
+
public:
|
71
|
+
CTimePickerDialog (const CDateTimeMessage *msg);
|
72
|
+
~CTimePickerDialog ();
|
73
|
+
|
74
|
+
time_t GetTime();
|
75
|
+
|
76
|
+
enum { IDD = IDD_TIME_PICKER };
|
77
|
+
|
78
|
+
BEGIN_MSG_MAP(CTimePickerDialog)
|
79
|
+
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
80
|
+
COMMAND_ID_HANDLER(IDOK, OnOK)
|
81
|
+
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
|
82
|
+
END_MSG_MAP()
|
83
|
+
|
84
|
+
private:
|
85
|
+
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
86
|
+
LRESULT OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
87
|
+
LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
88
|
+
|
89
|
+
private:
|
90
|
+
int m_format;
|
91
|
+
time_t m_returnTime;
|
92
|
+
time_t m_initialTime;
|
93
|
+
const char *m_title;
|
94
|
+
};
|
95
|
+
|
96
|
+
|
97
|
+
extern "C" void choose_datetime(char* callback, char* title,
|
98
|
+
long initial_time, int format, char* data);
|
99
|
+
|
100
|
+
#endif //__DATETIMEPICKER_H__
|
@@ -14,24 +14,20 @@
|
|
14
14
|
#endif
|
15
15
|
#include "resource.h"
|
16
16
|
#include "MainWindow.h"
|
17
|
-
#include "common/RhodesApp.h"
|
18
17
|
#include "common/StringConverter.h"
|
19
18
|
#include "AppManager.h"
|
20
19
|
#include "ext/rho/rhoruby.h"
|
20
|
+
#include "rubyext/WebView.h"
|
21
21
|
#if defined(_WIN32_WCE)
|
22
22
|
#include "camera/Camera.h"
|
23
23
|
#endif
|
24
24
|
#include "rho/net/NetRequest.h"
|
25
25
|
#include "sync/SyncThread.h"
|
26
|
+
#include "common/RhoFilePath.h"
|
26
27
|
|
27
|
-
|
28
|
-
//char* canonicalizeURL(const char* path);
|
29
|
-
//const char* strip_local_domain(const char* url);
|
30
|
-
|
31
|
-
//extern "C" wchar_t* wce_mbtowc(const char* a);
|
32
|
-
//extern "C" char* wce_wctomb(const wchar_t* w);
|
28
|
+
#include <hash_map>
|
33
29
|
|
34
|
-
|
30
|
+
IMPLEMENT_LOGCLASS(CMainWindow,"MainWindow");
|
35
31
|
|
36
32
|
#if defined(_WIN32_WCE)
|
37
33
|
#include <regext.h>
|
@@ -41,10 +37,13 @@ extern HREGNOTIFY g_hNotify;
|
|
41
37
|
|
42
38
|
#endif
|
43
39
|
|
40
|
+
#include "DateTimePicker.h"
|
41
|
+
|
44
42
|
extern "C" void rho_sysimpl_sethas_network(int nValue);
|
45
43
|
|
46
44
|
using namespace rho::common;
|
47
45
|
using namespace rho;
|
46
|
+
using namespace stdext;
|
48
47
|
|
49
48
|
#if !defined(_WIN32_WCE)
|
50
49
|
int CMainWindow::m_screenWidth;
|
@@ -54,13 +53,11 @@ int CMainWindow::m_screenHeight;
|
|
54
53
|
CMainWindow::CMainWindow()
|
55
54
|
{
|
56
55
|
m_bLoading = true;
|
57
|
-
m_bRhobundleReloadEnabled = true;
|
58
56
|
#if defined(_WIN32_WCE)
|
59
57
|
memset(&m_sai, 0, sizeof(m_sai));
|
60
58
|
m_sai.cbSize = sizeof(m_sai);
|
61
59
|
#endif
|
62
|
-
|
63
|
-
// m_szStartPage = NULL;
|
60
|
+
m_pageCounter = 0;
|
64
61
|
}
|
65
62
|
|
66
63
|
CMainWindow::~CMainWindow()
|
@@ -171,7 +168,8 @@ LRESULT CMainWindow::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
|
|
171
168
|
mbi.nToolBarId = IDR_MAIN_MENUBAR; // ID of toolbar resource
|
172
169
|
mbi.hInstRes = _AtlBaseModule.GetResourceInstance();
|
173
170
|
CBR(SHCreateMenuBar(&mbi));
|
174
|
-
|
171
|
+
m_hWndCECommandBar = mbi.hwndMB;
|
172
|
+
m_menuBar = m_hWndCECommandBar;
|
175
173
|
|
176
174
|
// Compute RECT for initial size and position.
|
177
175
|
// The following code should compute RECT appropriately
|
@@ -194,6 +192,8 @@ LRESULT CMainWindow::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
|
|
194
192
|
{
|
195
193
|
rcMainWindow.bottom = si.rcVisibleDesktop.bottom;
|
196
194
|
}
|
195
|
+
|
196
|
+
SetToolbarButtonEnabled(IDM_SK1_EXIT, FALSE);
|
197
197
|
#endif
|
198
198
|
|
199
199
|
#if !defined(_WIN32_WCE)
|
@@ -203,7 +203,13 @@ LRESULT CMainWindow::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*
|
|
203
203
|
|
204
204
|
MoveWindow(&rcMainWindow);
|
205
205
|
|
206
|
-
|
206
|
+
#if defined(_WIN32_WCE)
|
207
|
+
//Set fullscreen after window resizing
|
208
|
+
if ( RHOCONF().getBool("full_screen"))
|
209
|
+
SetFullScreen(true);
|
210
|
+
#endif
|
211
|
+
|
212
|
+
RHO_ASSERT(SUCCEEDED(hr));
|
207
213
|
Error:
|
208
214
|
|
209
215
|
return SUCCEEDED(hr) ? 0 : -1;
|
@@ -295,7 +301,6 @@ LRESULT CMainWindow::OnPaint(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/
|
|
295
301
|
LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
|
296
302
|
{
|
297
303
|
int fActive = LOWORD(wParam);
|
298
|
-
|
299
304
|
#if defined(_WIN32_WCE)
|
300
305
|
// Notify shell of our WM_ACTIVATE message
|
301
306
|
SHHandleWMActivate(m_hWnd, wParam, lParam, &m_sai, 0);
|
@@ -320,8 +325,17 @@ LRESULT CMainWindow::OnActivate(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOO
|
|
320
325
|
LRESULT CMainWindow::OnSettingChange(UINT /*uMsg*/, WPARAM wParam, LPARAM lParam, BOOL& /*bHandled*/)
|
321
326
|
{
|
322
327
|
#if defined(_WIN32_WCE)
|
323
|
-
|
324
|
-
|
328
|
+
|
329
|
+
//handle sreen rotation
|
330
|
+
int width = GetSystemMetrics(SM_CXSCREEN);
|
331
|
+
int height = GetSystemMetrics(SM_CYSCREEN);
|
332
|
+
|
333
|
+
if (wParam == SETTINGCHANGE_RESET) {
|
334
|
+
rho_rhodesapp_callScreenRotationCallback(width, height, 90);
|
335
|
+
}
|
336
|
+
|
337
|
+
// Notify shell of our WM_SETTINGCHANGE message
|
338
|
+
SHHandleWMSettingChange(m_hWnd, wParam, lParam, &m_sai);
|
325
339
|
#endif
|
326
340
|
return 0;
|
327
341
|
}
|
@@ -343,89 +357,15 @@ LRESULT CMainWindow::OnExitCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hW
|
|
343
357
|
return 0;
|
344
358
|
}
|
345
359
|
|
346
|
-
LRESULT CMainWindow::
|
347
|
-
{
|
348
|
-
// if ( m_szStartPage && m_current_url && _stricmp(m_current_url,m_szStartPage) != 0 )
|
349
|
-
rho::String strAppUrl = RHODESAPP().getAppBackUrl();
|
350
|
-
|
351
|
-
if ( strAppUrl.length() > 0 )
|
352
|
-
m_spIWebBrowser2->Navigate( const_cast<wchar_t*>(convertToStringW(strAppUrl).c_str()), NULL, NULL, NULL, NULL);
|
353
|
-
else if ( _stricmp(RHODESAPP().getCurrentUrl().c_str(),RHODESAPP().getStartUrl().c_str()) != 0 )
|
354
|
-
m_spIWebBrowser2->GoBack();
|
355
|
-
|
356
|
-
return 0;
|
357
|
-
}
|
358
|
-
|
359
|
-
LRESULT CMainWindow::OnForwardCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
360
|
+
LRESULT CMainWindow::OnNavigateBackCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
360
361
|
{
|
361
|
-
m_spIWebBrowser2->
|
362
|
+
m_spIWebBrowser2->GoBack();
|
362
363
|
return 0;
|
363
364
|
}
|
364
365
|
|
365
|
-
|
366
|
-
if ( m_bRhobundleReloadEnabled )
|
367
|
-
{
|
368
|
-
m_bRhobundleReloadEnabled = false;
|
369
|
-
|
370
|
-
#if defined(ENABLE_DYNAMIC_RHOBUNDLE) && defined(_WIN32_WCE)
|
371
|
-
if ( !CHttpServer::Instance()->GetRhobundleReloadUrl() ) //disable RhoBundle reload url
|
372
|
-
{
|
373
|
-
HMENU hMenu = (HMENU)m_menuBar.SendMessage(SHCMBM_GETSUBMENU, 0, IDM_SK2_MENU);
|
374
|
-
RemoveMenu(hMenu, IDM_RELOADRHOBUNDLE, MF_BYCOMMAND);
|
375
|
-
}
|
376
|
-
#elif defined(_WIN32_WCE)
|
377
|
-
HMENU hMenu = (HMENU)m_menuBar.SendMessage(SHCMBM_GETSUBMENU, 0, IDM_SK2_MENU);
|
378
|
-
RemoveMenu(hMenu, IDM_RELOADRHOBUNDLE, MF_BYCOMMAND);
|
379
|
-
#endif
|
380
|
-
}
|
381
|
-
}
|
382
|
-
|
383
|
-
LRESULT CMainWindow::OnHomeCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
384
|
-
{
|
385
|
-
//TODO: show menu on navigate to start page
|
386
|
-
SetRhobundleReloadMenu();
|
387
|
-
m_spIWebBrowser2->Navigate(
|
388
|
-
const_cast<wchar_t*>(convertToStringW(RHODESAPP().getStartUrl()).c_str()), NULL, NULL, NULL, NULL);
|
389
|
-
return 0;
|
390
|
-
}
|
391
|
-
#if 0
|
392
|
-
LRESULT CMainWindow::OnLoadStartPageCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
393
|
-
{
|
394
|
-
SetRhobundleReloadMenu();
|
395
|
-
|
396
|
-
LPTSTR startPage = NULL;
|
397
|
-
LPTSTR lastPageW = NULL;
|
398
|
-
|
399
|
-
if ( RHOCONF().getBool("KeepTrackOfLastVisitedPage") )
|
400
|
-
{
|
401
|
-
rho::String lastPage = RHOCONF().getString("LastVisitedPage");
|
402
|
-
if (lastPage.length() > 0) {
|
403
|
-
char* _page = canonicalizeURL(lastPage.c_str());
|
404
|
-
startPage = lastPageW = wce_mbtowc(_page);
|
405
|
-
free(_page);
|
406
|
-
}
|
407
|
-
}
|
408
|
-
|
409
|
-
if ( !startPage )
|
410
|
-
startPage = CHttpServer::Instance()->GetStartPage();
|
411
|
-
|
412
|
-
m_spIWebBrowser2->Navigate(startPage, NULL, NULL, NULL, NULL);
|
413
|
-
if (lastPageW) {
|
414
|
-
free(lastPageW);
|
415
|
-
}
|
416
|
-
|
417
|
-
return 0;
|
418
|
-
}
|
419
|
-
#endif //0
|
420
|
-
|
421
|
-
LRESULT CMainWindow::OnOpenURLCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
366
|
+
LRESULT CMainWindow::OnBackCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
422
367
|
{
|
423
|
-
|
424
|
-
int nRetCode = getURLDialog.DoModal(m_hWnd); // display the 'Get URL' dialog box
|
425
|
-
if (IDOK == nRetCode)
|
426
|
-
{
|
427
|
-
m_spIWebBrowser2->Navigate(getURLDialog.GetURL(), NULL, NULL, NULL, NULL);
|
428
|
-
}
|
368
|
+
RHODESAPP().navigateBack();
|
429
369
|
return 0;
|
430
370
|
}
|
431
371
|
|
@@ -445,81 +385,34 @@ LRESULT CMainWindow::OnLogCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWn
|
|
445
385
|
return 0;
|
446
386
|
}
|
447
387
|
|
448
|
-
LRESULT CMainWindow::
|
388
|
+
LRESULT CMainWindow::OnFullscreenCommand (WORD /*wNotifyCode*/, WORD /*wID*/, HWND hwnd, BOOL& /*bHandled*/)
|
449
389
|
{
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
rho::common::convertToStringW(RHODESAPP().getCurrentUrl().c_str(), strCurrentUrlW);
|
456
|
-
Navigate2(const_cast<wchar_t*>(strCurrentUrlW.c_str()));
|
457
|
-
|
458
|
-
// free(wcurl);
|
459
|
-
return 0;
|
460
|
-
}
|
390
|
+
#if defined (_WIN32_WCE)
|
391
|
+
SetFullScreen(!m_bFullScreen);
|
392
|
+
#endif
|
393
|
+
return 0;
|
394
|
+
};
|
461
395
|
|
462
396
|
LRESULT CMainWindow::OnNavigateCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND hWndCtl, BOOL& /*bHandled*/)
|
463
397
|
{
|
464
398
|
LPTSTR wcurl = (LPTSTR)hWndCtl;
|
465
|
-
if (wcurl)
|
399
|
+
if (wcurl)
|
400
|
+
{
|
466
401
|
Navigate2(wcurl);
|
467
402
|
free(wcurl);
|
468
403
|
}
|
469
404
|
return 0;
|
470
405
|
}
|
471
406
|
|
472
|
-
|
473
|
-
|
474
|
-
m_spIWebBrowser2->Stop();
|
475
|
-
return 0;
|
476
|
-
}
|
477
|
-
|
478
|
-
|
479
|
-
LRESULT CMainWindow::OnSyncCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
407
|
+
#if defined(OS_WINDOWS)
|
408
|
+
LRESULT CMainWindow::OnPopupMenuCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
480
409
|
{
|
481
|
-
|
482
|
-
return 0;
|
483
|
-
}
|
484
|
-
|
485
|
-
LRESULT CMainWindow::OnOptionsCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
|
486
|
-
m_spIWebBrowser2->Navigate(const_cast<wchar_t*>(convertToStringW(RHODESAPP().getOptionsUrl()).c_str()), NULL, NULL, NULL, NULL);
|
410
|
+
createCustomMenu();
|
487
411
|
return 0;
|
488
412
|
}
|
489
413
|
|
490
|
-
LRESULT CMainWindow::
|
414
|
+
LRESULT CMainWindow::OnPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
|
491
415
|
{
|
492
|
-
#ifdef ENABLE_DYNAMIC_RHOBUNDLE
|
493
|
-
if ( RHODESAPP().getRhobundleReloadUrl().length()>0 ) {
|
494
|
-
CAppManager::ReloadRhoBundle(m_hWnd,RHODESAPP().getRhobundleReloadUrl().c_str(), NULL);
|
495
|
-
} else {
|
496
|
-
MessageBox(_T("Path to the bundle is not defined."),_T("Information"), MB_OK | MB_ICONINFORMATION );
|
497
|
-
}
|
498
|
-
#endif
|
499
|
-
return 0;
|
500
|
-
}
|
501
|
-
|
502
|
-
#if defined(OS_WINDOWS)
|
503
|
-
LRESULT CMainWindow::OnPopupMenuCommand(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
|
504
|
-
CMenu menu;
|
505
|
-
CMenu sub;
|
506
|
-
RECT rect;
|
507
|
-
|
508
|
-
m_browser.GetWindowRect(&rect);
|
509
|
-
|
510
|
-
VERIFY(menu.LoadMenu(IDR_MAIN_MENU));
|
511
|
-
sub.Attach(menu.GetSubMenu(0));
|
512
|
-
sub.TrackPopupMenu(
|
513
|
-
TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON | TPM_VERNEGANIMATION,
|
514
|
-
rect.right-1,
|
515
|
-
rect.bottom-1,
|
516
|
-
m_hWnd);
|
517
|
-
sub.Detach();
|
518
|
-
|
519
|
-
return 0;
|
520
|
-
}
|
521
|
-
|
522
|
-
LRESULT CMainWindow::OnPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled) {
|
523
416
|
LPWINDOWPOS lp = (LPWINDOWPOS)lParam;
|
524
417
|
setIniInt(_T("main_view_left"),lp->x);
|
525
418
|
setIniInt(_T("main_view_top"),lp->y);
|
@@ -527,37 +420,9 @@ LRESULT CMainWindow::OnPosChanged(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lPara
|
|
527
420
|
return 0;
|
528
421
|
}
|
529
422
|
#endif
|
530
|
-
/*
|
531
|
-
void CMainWindow::SendCameraCallbackRequest(HRESULT status, LPTSTR image_name, char* callback_url) {
|
532
|
-
|
533
|
-
rho::String callback = RHODESAPP().canonicalizeRhoUrl(callback_url);
|
534
|
-
|
535
|
-
char* imageuri = NULL, *message;
|
536
|
-
if (status==S_OK) {
|
537
|
-
imageuri = wce_wctomb(image_name);
|
538
|
-
int len = 256+strlen(imageuri);
|
539
|
-
message = (char*) malloc(len);
|
540
|
-
sprintf(message,"status=ok&image_uri=%s",imageuri);
|
541
|
-
} else {
|
542
|
-
char* status_message = (status==S_FALSE?"User canceled operation":"Error");
|
543
|
-
int len = 256+strlen(status_message);
|
544
|
-
message = (char*) malloc(len);
|
545
|
-
sprintf(message,"status=%s&message=%s",
|
546
|
-
(status==S_FALSE?"cancel":"error"),status_message);
|
547
|
-
}
|
548
|
-
|
549
|
-
// char* headers = "Content-Type: application/x-www-form-urlencoded\r\n";
|
550
|
-
//char* res = m_callbackRequest.doRequest(L"POST",callback,headers,strlen(headers),message,strlen(message));
|
551
|
-
//if ( res ) free(res);
|
552
|
-
rho::net::CNetRequest oNetReq;
|
553
|
-
oNetReq.pushData( callback, message, null );
|
554
|
-
|
555
|
-
free(message);
|
556
|
-
if (imageuri)
|
557
|
-
free(imageuri);
|
558
|
-
}*/
|
559
423
|
|
560
|
-
LRESULT CMainWindow::OnTakePicture(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
|
424
|
+
LRESULT CMainWindow::OnTakePicture(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
|
425
|
+
{
|
561
426
|
#if defined (_WIN32_WCE)
|
562
427
|
Camera camera;
|
563
428
|
TCHAR image_uri[MAX_PATH];
|
@@ -571,7 +436,8 @@ LRESULT CMainWindow::OnTakePicture(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lPar
|
|
571
436
|
return 0;
|
572
437
|
}
|
573
438
|
|
574
|
-
LRESULT CMainWindow::OnConnectionsNetworkCount(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
439
|
+
LRESULT CMainWindow::OnConnectionsNetworkCount(UINT /*uMsg*/, WPARAM wParam, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
440
|
+
{
|
575
441
|
#if defined (_WIN32_WCE)
|
576
442
|
|
577
443
|
rho_sysimpl_sethas_network( (int)wParam );
|
@@ -588,6 +454,7 @@ LRESULT CMainWindow::OnSelectPicture(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lP
|
|
588
454
|
Camera camera;
|
589
455
|
status = camera.selectPicture(this->m_hWnd,image_uri);
|
590
456
|
#else
|
457
|
+
//TODO: show browse file dialog
|
591
458
|
wsprintf( image_uri, L"%s", L"dashboard.PNG");
|
592
459
|
#endif
|
593
460
|
|
@@ -621,6 +488,30 @@ LRESULT CMainWindow::OnAlertShowPopup (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM
|
|
621
488
|
return 0;
|
622
489
|
}
|
623
490
|
|
491
|
+
LRESULT CMainWindow::OnDateTimePicker (UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
|
492
|
+
{
|
493
|
+
CDateTimeMessage *msg = (CDateTimeMessage *)lParam;
|
494
|
+
int retCode = -1;
|
495
|
+
time_t ret_time = 0;
|
496
|
+
|
497
|
+
if (msg->m_format == CDateTimeMessage::FORMAT_TIME) {
|
498
|
+
CTimePickerDialog timeDialog(msg);
|
499
|
+
retCode = timeDialog.DoModal(m_hWnd);
|
500
|
+
ret_time = timeDialog.GetTime();
|
501
|
+
} else {
|
502
|
+
CDateTimePickerDialog dateTimeDialog(msg);
|
503
|
+
retCode = dateTimeDialog.DoModal(m_hWnd);
|
504
|
+
ret_time = dateTimeDialog.GetTime();
|
505
|
+
}
|
506
|
+
|
507
|
+
rho_rhodesapp_callDateTimeCallback( msg->m_callback,
|
508
|
+
retCode == IDOK ? (long )ret_time : 0,
|
509
|
+
msg->m_data,
|
510
|
+
retCode == IDOK ? 0 : 1);
|
511
|
+
delete msg;
|
512
|
+
|
513
|
+
return 0;
|
514
|
+
}
|
624
515
|
|
625
516
|
// **************************************************************************
|
626
517
|
//
|
@@ -643,8 +534,8 @@ void __stdcall CMainWindow::OnBeforeNavigate2(IDispatch* pDisp, VARIANT * pvtURL
|
|
643
534
|
SetWindowText(convertToStringW(strTitle).c_str());
|
644
535
|
else
|
645
536
|
SetWindowText(TEXT("Untitled"));
|
646
|
-
|
647
|
-
RHO_ASSERT(
|
537
|
+
|
538
|
+
//RHO_ASSERT(SetMenuItemEnabled(IDM_STOP, TRUE));
|
648
539
|
}
|
649
540
|
|
650
541
|
void __stdcall CMainWindow::OnBrowserTitleChange(BSTR bstrTitleText)
|
@@ -736,9 +627,9 @@ void CMainWindow::ShowLoadingPage(LPDISPATCH pDisp, VARIANT* URL)
|
|
736
627
|
|
737
628
|
void __stdcall CMainWindow::OnDocumentComplete(IDispatch* pDisp, VARIANT * pvtURL)
|
738
629
|
{
|
630
|
+
LOG(INFO) + "Show loading page";
|
739
631
|
USES_CONVERSION;
|
740
632
|
|
741
|
-
//BOOL store_current_url = !m_bLoading;
|
742
633
|
LPCTSTR url = OLE2CT(V_BSTR(pvtURL));
|
743
634
|
if (m_bLoading && wcscmp(url,_T("about:blank"))==0) {
|
744
635
|
LOG(TRACE) + "Show loading page";
|
@@ -748,35 +639,32 @@ void __stdcall CMainWindow::OnDocumentComplete(IDispatch* pDisp, VARIANT * pvtUR
|
|
748
639
|
m_bLoading = false; //show loading page only once
|
749
640
|
}else
|
750
641
|
{
|
751
|
-
// if ( m_current_url && strcmp(m_current_url,"about:blank") ==0 )
|
752
|
-
// m_szStartPage = wce_wctomb(url);
|
753
642
|
}
|
754
643
|
m_bLoading = false;
|
755
644
|
|
756
|
-
/*if (m_current_url) {
|
757
|
-
free(m_current_url);
|
758
|
-
}
|
759
|
-
|
760
|
-
m_current_url = wce_wctomb(url);*/
|
761
|
-
|
762
|
-
//if( store_current_url )
|
763
|
-
// RHODESAPP().keepLastVisitedUrlW(url);
|
764
|
-
|
765
645
|
LOG(TRACE) + "OnDocumentComplete: " + url;
|
766
646
|
|
767
|
-
|
647
|
+
#if defined (_WIN32_WCE)
|
648
|
+
createCustomMenu();
|
649
|
+
|
650
|
+
m_pageCounter++;
|
651
|
+
if (m_pageCounter > 2) //"loading" page + first page
|
652
|
+
SetToolbarButtonEnabled(IDM_SK1_EXIT, TRUE);
|
653
|
+
#endif
|
654
|
+
//RHO_ASSERT(SetMenuItemEnabled(IDM_STOP, FALSE));
|
768
655
|
}
|
769
656
|
|
770
657
|
void __stdcall CMainWindow::OnCommandStateChange(long lCommand, BOOL bEnable)
|
771
658
|
{
|
772
659
|
/*if (CSC_NAVIGATEBACK == lCommand)
|
773
660
|
{
|
774
|
-
RHO_ASSERT(
|
661
|
+
RHO_ASSERT(SetMenuItemEnabled(IDM_BACK, bEnable));
|
775
662
|
}
|
776
|
-
else */
|
663
|
+
else */
|
664
|
+
/*if (CSC_NAVIGATEFORWARD == lCommand)
|
777
665
|
{
|
778
|
-
RHO_ASSERT(
|
779
|
-
}
|
666
|
+
RHO_ASSERT(SetMenuItemEnabled(IDM_FORWARD, bEnable));
|
667
|
+
}*/
|
780
668
|
}
|
781
669
|
|
782
670
|
// **************************************************************************
|
@@ -784,15 +672,25 @@ void __stdcall CMainWindow::OnCommandStateChange(long lCommand, BOOL bEnable)
|
|
784
672
|
// utility function
|
785
673
|
//
|
786
674
|
// **************************************************************************
|
787
|
-
BOOL CMainWindow::
|
675
|
+
BOOL CMainWindow::SetMenuItemEnabled(UINT uMenuItemID, BOOL bEnable)
|
788
676
|
{
|
677
|
+
return TRUE;
|
678
|
+
}
|
679
|
+
|
680
|
+
BOOL CMainWindow::SetToolbarButtonEnabled(UINT uTbbID, BOOL bEnable)
|
681
|
+
{
|
682
|
+
|
789
683
|
#if defined(_WIN32_WCE)
|
790
|
-
|
791
|
-
|
792
|
-
|
684
|
+
TBBUTTONINFO tbbi;
|
685
|
+
tbbi.cbSize = sizeof(tbbi);
|
686
|
+
tbbi.dwMask = TBIF_STATE;
|
687
|
+
tbbi.fsState = bEnable ? TBSTATE_ENABLED : TBSTATE_INDETERMINATE;
|
688
|
+
::SendMessage (m_menuBar, TB_SETBUTTONINFO, uTbbID, (LPARAM)&tbbi);
|
689
|
+
return TRUE;
|
793
690
|
#else
|
794
691
|
return TRUE;
|
795
692
|
#endif
|
693
|
+
|
796
694
|
}
|
797
695
|
|
798
696
|
// **************************************************************************
|
@@ -805,13 +703,30 @@ BOOL CMainWindow::SetEnabledState(UINT uMenuItemID, BOOL bEnable)
|
|
805
703
|
// **************************************************************************
|
806
704
|
BOOL CMainWindow::TranslateAccelerator(MSG* pMsg)
|
807
705
|
{
|
706
|
+
#ifdef OS_WINCE
|
707
|
+
if (pMsg->message == WM_CONTEXTMENU){
|
708
|
+
/*
|
709
|
+
CMenuHandle menu;
|
710
|
+
menu.LoadMenu(IDR_MAIN_MENU);
|
711
|
+
menu = menu.GetSubMenu(0);
|
712
|
+
return menu.TrackPopupMenu( TPM_CENTERALIGN | TPM_VERTICAL, LOWORD(pMsg->lParam), HIWORD(pMsg->lParam), m_hWnd);
|
713
|
+
*/
|
714
|
+
|
715
|
+
return TRUE;
|
716
|
+
}
|
717
|
+
|
718
|
+
if (m_bFullScreen && pMsg->message == WM_KEYUP &&
|
719
|
+
(pMsg->wParam == VK_F1 || pMsg->wParam == VK_F2))
|
720
|
+
SetFullScreen(false);
|
721
|
+
#endif
|
722
|
+
|
808
723
|
// Accelerators are only keyboard or mouse messages
|
809
724
|
UINT uMsg = pMsg->message;
|
810
725
|
if (!(WM_KEYFIRST <= uMsg && uMsg <= WM_KEYLAST) &&
|
811
726
|
!(WM_MOUSEFIRST <= uMsg && uMsg <= WM_MOUSELAST))
|
812
727
|
{
|
813
728
|
|
814
|
-
#ifdef OS_WINCE
|
729
|
+
#ifdef OS_WINCE
|
815
730
|
if ( uMsg == WM_HOTKEY )
|
816
731
|
{
|
817
732
|
int idHotKey = (int) pMsg->wParam;
|
@@ -820,7 +735,8 @@ BOOL CMainWindow::TranslateAccelerator(MSG* pMsg)
|
|
820
735
|
|
821
736
|
if ( uVirtKey == VK_ESCAPE ){
|
822
737
|
if ( fuModifiers&MOD_KEYUP )
|
823
|
-
|
738
|
+
RHODESAPP().navigateBack();
|
739
|
+
//PostMessageW(WM_COMMAND,MAKEWPARAM(IDM_BACK,1),NULL);
|
824
740
|
|
825
741
|
return TRUE;
|
826
742
|
}
|
@@ -856,3 +772,100 @@ BOOL CMainWindow::TranslateAccelerator(MSG* pMsg)
|
|
856
772
|
// ::TranslateAccelerator() function here, instead of simply returning FALSE.
|
857
773
|
return FALSE;
|
858
774
|
}
|
775
|
+
|
776
|
+
#if defined (OS_WINDOWS)
|
777
|
+
void CMainWindow::createCustomMenu()
|
778
|
+
{
|
779
|
+
CMenu menu;
|
780
|
+
CMenu sub;
|
781
|
+
CMenu popup;
|
782
|
+
|
783
|
+
VERIFY(menu.CreateMenu());
|
784
|
+
VERIFY(popup.CreatePopupMenu());
|
785
|
+
menu.AppendMenu(MF_POPUP, (UINT) popup.m_hMenu, _T(""));
|
786
|
+
|
787
|
+
RHODESAPP().getAppMenu().copyMenuItems(m_arAppMenuItems);
|
788
|
+
|
789
|
+
#ifdef ENABLE_DYNAMIC_RHOBUNDLE
|
790
|
+
String strIndexPage = CFilePath::join(RHODESAPP().getStartUrl(),"index_erb.iseq");
|
791
|
+
if ( RHODESAPP().getCurrentUrl().compare(RHODESAPP().getStartUrl()) == 0 ||
|
792
|
+
RHODESAPP().getCurrentUrl().compare(strIndexPage) == 0 )
|
793
|
+
m_arAppMenuItems.addElement(CAppMenuItem("Reload RhoBundle","reload_rhobundle"));
|
794
|
+
#endif //ENABLE_DYNAMIC_RHOBUNDLE
|
795
|
+
|
796
|
+
//update UI with custom menu items
|
797
|
+
USES_CONVERSION;
|
798
|
+
for ( int i = m_arAppMenuItems.size() - 1; i >= 0; i--)
|
799
|
+
{
|
800
|
+
CAppMenuItem& oItem = m_arAppMenuItems.elementAt(i);
|
801
|
+
if (oItem.m_eType == CAppMenuItem::emtSeparator)
|
802
|
+
popup.InsertMenu(0, MF_BYPOSITION | MF_SEPARATOR, (UINT_PTR)0, (LPCTSTR)0);
|
803
|
+
else
|
804
|
+
popup.InsertMenu(0, MF_BYPOSITION, ID_CUSTOM_MENU_ITEM_FIRST + i,
|
805
|
+
oItem.m_eType == CAppMenuItem::emtClose ? _T("Exit") : A2T(oItem.m_strLabel.c_str()) );
|
806
|
+
}
|
807
|
+
|
808
|
+
RECT rect;
|
809
|
+
m_browser.GetWindowRect(&rect);
|
810
|
+
sub.Attach(menu.GetSubMenu(0));
|
811
|
+
sub.TrackPopupMenu( TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON | TPM_VERNEGANIMATION,
|
812
|
+
rect.right-1,
|
813
|
+
rect.bottom-1,
|
814
|
+
m_hWnd);
|
815
|
+
sub.Detach();
|
816
|
+
}
|
817
|
+
|
818
|
+
#endif//OS_WINDOWS
|
819
|
+
|
820
|
+
#if defined (OS_WINCE)
|
821
|
+
|
822
|
+
void CMainWindow::createCustomMenu()
|
823
|
+
{
|
824
|
+
HMENU hMenu = (HMENU)m_menuBar.SendMessage(SHCMBM_GETSUBMENU, 0, IDM_SK2_MENU);
|
825
|
+
|
826
|
+
//except exit item
|
827
|
+
int num = GetMenuItemCount (hMenu);
|
828
|
+
for (int i = 0; i < (num - 1); i++)
|
829
|
+
DeleteMenu(hMenu, 0, MF_BYPOSITION);
|
830
|
+
|
831
|
+
RHODESAPP().getAppMenu().copyMenuItems(m_arAppMenuItems);
|
832
|
+
|
833
|
+
//update UI with cusom menu items
|
834
|
+
USES_CONVERSION;
|
835
|
+
for ( int i = m_arAppMenuItems.size() - 1; i >= 0; i--)
|
836
|
+
{
|
837
|
+
CAppMenuItem& oItem = m_arAppMenuItems.elementAt(i);
|
838
|
+
if (oItem.m_eType == CAppMenuItem::emtSeparator)
|
839
|
+
InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
|
840
|
+
else if (oItem.m_eType != CAppMenuItem::emtExit && oItem.m_eType != CAppMenuItem::emtClose)
|
841
|
+
InsertMenu(hMenu, 0, MF_BYPOSITION, ID_CUSTOM_MENU_ITEM_FIRST + i, A2T(oItem.m_strLabel.c_str()));
|
842
|
+
}
|
843
|
+
}
|
844
|
+
#endif //OS_WINCE
|
845
|
+
|
846
|
+
LRESULT CMainWindow::OnCustomMenuItemCommand (WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
847
|
+
{
|
848
|
+
int nItemPos = wID-ID_CUSTOM_MENU_ITEM_FIRST;
|
849
|
+
if ( nItemPos < 0 || nItemPos >= (int)m_arAppMenuItems.size() )
|
850
|
+
return 0;
|
851
|
+
|
852
|
+
CAppMenuItem& oMenuItem = m_arAppMenuItems.elementAt(nItemPos);
|
853
|
+
if ( oMenuItem.m_eType == CAppMenuItem::emtUrl )
|
854
|
+
{
|
855
|
+
if ( oMenuItem.m_strLink == "reload_rhobundle" )
|
856
|
+
{
|
857
|
+
#ifdef ENABLE_DYNAMIC_RHOBUNDLE
|
858
|
+
if ( RHODESAPP().getRhobundleReloadUrl().length()>0 ) {
|
859
|
+
CAppManager::ReloadRhoBundle(m_hWnd,RHODESAPP().getRhobundleReloadUrl().c_str(), NULL);
|
860
|
+
} else {
|
861
|
+
MessageBox(_T("Path to the bundle is not defined."),_T("Information"), MB_OK | MB_ICONINFORMATION );
|
862
|
+
}
|
863
|
+
#endif
|
864
|
+
return 0;
|
865
|
+
}
|
866
|
+
}
|
867
|
+
|
868
|
+
oMenuItem.processCommand();
|
869
|
+
|
870
|
+
return 0;
|
871
|
+
}
|