rhodes 5.5.2 → 5.5.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/CREDITS +3 -3
- data/LICENSE +1 -1
- data/README.html +1 -1
- data/Rakefile +53 -14
- data/bin/get-rhodes-info +0 -0
- data/extensions/rhoconnect-push/ext/rhoconnect-push/platform/android/Rakefile +1 -1
- data/lib/build/jake.rb +11 -0
- data/lib/commonAPI/barcode/ext/platform/iphone/impl/BarcodeFactory.m +2 -1
- data/lib/commonAPI/coreapi/ext/NativeTabbar.xml +4 -0
- data/lib/commonAPI/coreapi/ext/platform/iphone/cpp_based_impl/SystemImpl.mm +1 -0
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m +7 -2
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeToolbarSingleton.m +6 -2
- data/lib/commonAPI/coreapi/ext/platform/iphone/impl/NavbarSingleton.m +8 -2
- data/lib/commonAPI/coreapi/ext/shared/ApplicationImpl.cpp +3 -0
- data/lib/commonAPI/coreapi/ext/shared/NetworkImpl.cpp +1 -0
- data/lib/commonAPI/coreapi/ext/shared/TimerImpl.cpp +36 -27
- data/lib/commonAPI/coreapi/public/api/rhoapi.js +6 -3
- data/lib/commonAPI/mediacapture/ext.yml +1 -2
- data/lib/commonAPI/mediacapture/ext/build.bat +8 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/MediaCapture.pro +82 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/Rakefile +35 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaClosed.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/diaOpened.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/mediacapture.qrc +7 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/resources/photoSave.png +0 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.cpp +83 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CCameraData.h +54 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogBuilder.h +36 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogController.h +31 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/CameraDialogView.h +73 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/Camera_impl.cpp +337 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFileNameGetter.h +40 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/ImageFilenameGetterResult.h +36 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameracrossthreadhalper.h +17 -0
- data/lib/commonAPI/mediacapture/ext/platform/qt/src/cameradialogview.cpp +178 -0
- data/lib/commonAPI/mediacapture/ext/shared/MediacaptureInit.cpp +8 -8
- data/lib/framework/rhodes.rb +1 -1
- data/lib/framework/version.rb +1 -1
- data/platform/android/Rhodes/AndroidManifest.xml.erb +1 -1
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java +9 -2
- data/platform/android/Rhodes/src/com/rhomobile/rhodes/mainview/SplashScreen.java +33 -0
- data/platform/android/build/android.rake +97 -43
- data/platform/android/build/android_studio_project_generator.rb +21 -0
- data/platform/android/build/android_tools.rb +8 -6
- data/platform/iphone/Classes/AppManager/AppManager.h +6 -0
- data/platform/iphone/Classes/AppManager/AppManager.m +76 -37
- data/platform/iphone/Classes/MapView/GoogleGeocoder.m +2 -3
- data/platform/iphone/Classes/MapView/MapViewController.m +3 -3
- data/platform/iphone/Classes/NativeBar.h +1 -0
- data/platform/iphone/Classes/NativeBar.m +15 -0
- data/platform/iphone/Classes/RhoViewController.m +8 -3
- data/platform/iphone/Classes/RhoWKWebView.m +1 -1
- data/platform/iphone/Classes/Rhodes.m +55 -38
- data/platform/iphone/Classes/SimpleMainView.m +3 -2
- data/platform/iphone/Classes/TabbedMainView.h +2 -0
- data/platform/iphone/Classes/TabbedMainView.m +15 -3
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.h +2 -0
- data/platform/iphone/Classes/URLProtocol/CRhoURLProtocol.m +185 -30
- data/platform/iphone/Classes/rho/net/IPhoneNetRequest.mm +105 -6
- data/platform/iphone/rbuild/iphone.rake +426 -267
- data/platform/iphone/rbuild/putsOverride.rake +8 -0
- data/platform/shared/api_generator/iphone/CJSConverter.mm +5 -3
- data/platform/shared/common/BundleManager.cpp +16 -6
- data/platform/shared/common/PosixThreadImpl.cpp +10 -4
- data/platform/shared/common/RhoTime.cpp +81 -40
- data/platform/shared/common/RhodesApp.cpp +2 -2
- data/platform/shared/common/RhodesApp.h +1 -1
- data/platform/shared/db/DBAdapter.cpp +33 -0
- data/platform/shared/db/DBAdapter.h +5 -0
- data/platform/shared/logging/RhoLogConf.cpp +17 -1
- data/platform/shared/logging/RhoLogConf.h +6 -0
- data/platform/shared/net/CURLNetRequest.cpp +6 -0
- data/platform/shared/net/HttpServer.cpp +27 -1
- data/platform/shared/net/INetRequest.cpp +33 -6
- data/platform/shared/net/INetRequest.h +2 -0
- data/platform/shared/qt/RhoSimulator_dev.pro +14 -10
- data/platform/shared/qt/rhodes/QtMainWindow.cpp +2 -2
- data/platform/shared/qt/rhodes/iexecutable.h +27 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.cpp +5 -0
- data/platform/shared/qt/rhodes/impl/MainWindowImpl.h +3 -0
- data/platform/shared/qt/rhodes/qkineticscroller.cpp +2 -2
- data/platform/shared/qt/rhodes/qkineticscroller_p.h +1 -1
- data/platform/shared/qt/rhodes/qtscrollerfilter.cpp +3 -3
- data/platform/shared/qt/rhodes/qtscrollevent.cpp +2 -2
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.cpp +1 -1
- data/platform/shared/qt/rhodes/qwebviewkineticscroller.h +1 -1
- data/platform/shared/qt/rhodes/resources/rho.png +0 -0
- data/platform/shared/qt/rhodes/rhodes.pro +3 -2
- data/platform/wm/build/wm.rake +28 -9
- data/platform/wm/rhodes/browser/BrowserFactory.cpp +4 -6
- data/platform/wm/rhodes/browser/stubs.cpp +5 -0
- data/platform/wm/rhodes/rho/net/NetRequestImpl.h +3 -0
- data/platform/wm/rhodes/rhodes.vcproj +31 -2
- data/rakefile.rb +53 -14
- data/res/build-tools/iphonesim/build/Release/iphonesim_8 +2 -2
- data/res/generators/rhogen.rb +6 -147
- data/res/generators/templates/api/platform/iphone/generated/base_impl/MontanaBase.m +7 -7
- data/res/generators/templates/api/platform/iphone/generated/javascript/montana_js_wrap.mm +2 -4
- data/res/generators/templates/application/AndroidManifest.erb +1 -1
- data/res/generators/templates/application/app/Settings/home.erb +1 -1
- data/res/generators/templates/application/build.yml +52 -6
- data/res/generators/templates/application/icon/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-hdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-ldpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-mdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable-xxxhdpi/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/ic_notification.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/drawable/loading.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-hdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-ldpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-mdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap-xxxhdpi/icon.png +0 -0
- data/res/generators/templates/application/resources/android/res/mipmap/icon.png +0 -0
- data/res/generators/templates/application/{app/loading-568h@2x.png → resources/ios/Default-568h@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-667h@2x.png → resources/ios/Default-667h@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-736h@3x.png → resources/ios/Default-736h@3x.png} +0 -0
- data/res/generators/templates/application/{app/loading-Landscape.png → resources/ios/Default-Landscape.png} +0 -0
- data/res/generators/templates/application/{app/loading-Landscape@2x.png → resources/ios/Default-Landscape@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeLeft.png → resources/ios/Default-LandscapeLeft.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeLeft@2x.png → resources/ios/Default-LandscapeLeft@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeRight.png → resources/ios/Default-LandscapeRight.png} +0 -0
- data/res/generators/templates/application/{app/loading-LandscapeRight@2x.png → resources/ios/Default-LandscapeRight@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-Portrait.png → resources/ios/Default-Portrait.png} +0 -0
- data/res/generators/templates/application/{app/loading-Portrait@2x.png → resources/ios/Default-Portrait@2x.png} +0 -0
- data/res/generators/templates/application/{app/loading-PortraitUpsideDown.png → resources/ios/Default-PortraitUpsideDown.png} +0 -0
- data/res/generators/templates/application/{app/loading-PortraitUpsideDown@2x.png → resources/ios/Default-PortraitUpsideDown@2x.png} +0 -0
- data/res/generators/templates/application/resources/ios/Default.png +0 -0
- data/res/generators/templates/application/{app/loading@2x.png → resources/ios/Default@2x.png} +0 -0
- data/res/generators/templates/application/resources/ios/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/resources/ios/iTunesArtwork@2x.png +0 -0
- data/res/generators/templates/application/resources/ios/icon114.png +0 -0
- data/res/generators/templates/application/resources/ios/icon120.png +0 -0
- data/res/generators/templates/application/resources/ios/icon144.png +0 -0
- data/res/generators/templates/application/resources/ios/icon152.png +0 -0
- data/res/generators/templates/application/resources/ios/icon180.png +0 -0
- data/res/generators/templates/application/resources/ios/icon57.png +0 -0
- data/res/generators/templates/application/resources/ios/icon60.png +0 -0
- data/res/generators/templates/application/resources/ios/icon72.png +0 -0
- data/res/generators/templates/application/resources/ios/icon76.png +0 -0
- data/res/generators/templates/application/rhoconfig.txt +2 -1
- data/res/generators/templates/iphone_project/Bremen7.xcodeproj/project.pbxproj +44 -0
- data/res/generators/templates/iphone_project/Resources/back_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/back_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/back_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/forward_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/gears@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/home_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn@2x.png +0 -0
- data/res/generators/templates/iphone_project/Resources/sync_btn@3x.png +0 -0
- data/res/generators/templates/iphone_project/buildRhoBundle +23 -7
- data/res/generators/templates/iphone_project/root/Info.plist +0 -7
- data/res/generators/templates/iphone_project/root/iTunesArtwork +0 -0
- data/res/generators/templates/iphone_project/root/iTunesArtwork@2x +0 -0
- data/res/generators/templates/iphone_project/root/icon114.png +0 -0
- data/res/generators/templates/iphone_project/root/icon120.png +0 -0
- data/res/generators/templates/iphone_project/root/icon144.png +0 -0
- data/res/generators/templates/iphone_project/root/icon152.png +0 -0
- data/res/generators/templates/iphone_project/root/icon180.png +0 -0
- data/res/generators/templates/iphone_project/root/icon57.png +0 -0
- data/res/generators/templates/iphone_project/root/icon60.png +0 -0
- data/res/generators/templates/iphone_project/root/icon72.png +0 -0
- data/res/generators/templates/iphone_project/root/icon76.png +0 -0
- data/res/generators/templates/project/android_studio_project/app/build.gradle.erb +88 -0
- data/res/generators/templates/project/android_studio_project/build.gradle +23 -0
- data/res/generators/templates/project/android_studio_project/gradle.properties +17 -0
- data/res/generators/templates/project/android_studio_project/gradlew +160 -0
- data/res/generators/templates/project/android_studio_project/gradlew.bat +90 -0
- data/res/generators/templates/project/android_studio_project/settings.gradle +1 -0
- data/rhodes.gemspec +7 -6
- data/version +1 -1
- metadata +135 -42
- data/res/generators/templates/application/icon/icon.svg +0 -22
- data/res/generators/templates/application/icon/icon114.png +0 -0
- data/res/generators/templates/application/icon/icon120.png +0 -0
- data/res/generators/templates/application/icon/icon144.png +0 -0
- data/res/generators/templates/application/icon/icon152.png +0 -0
- data/res/generators/templates/application/icon/icon180.png +0 -0
- data/res/generators/templates/application/icon/icon57.png +0 -0
- data/res/generators/templates/application/icon/icon60.png +0 -0
- data/res/generators/templates/application/icon/icon72.png +0 -0
- data/res/generators/templates/application/icon/icon76.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork.png +0 -0
- data/res/generators/templates/application/production/iTunesArtwork@2x.png +0 -0
@@ -497,7 +497,7 @@ var Rho = Rho || (function ($) {
|
|
497
497
|
};
|
498
498
|
|
499
499
|
(function propertySupportCheck() {
|
500
|
-
propsSupport.ffHackKeywords = (function supported_firefoxHack_keywords() {
|
500
|
+
/* propsSupport.ffHackKeywords = (function supported_firefoxHack_keywords() {
|
501
501
|
var testObj = {};
|
502
502
|
var okGet = false;
|
503
503
|
var okSet = false;
|
@@ -514,7 +514,7 @@ var Rho = Rho || (function ($) {
|
|
514
514
|
testObj.propSet = testObj.propGet;
|
515
515
|
} catch (ex) {};
|
516
516
|
return okGet && okSet;
|
517
|
-
})()
|
517
|
+
})();*/
|
518
518
|
|
519
519
|
propsSupport.ffHackMethod = (function supported_firefoxHack_method() {
|
520
520
|
var testObj = {};
|
@@ -1047,7 +1047,8 @@ var Rho = Rho || (function ($) {
|
|
1047
1047
|
});
|
1048
1048
|
|
1049
1049
|
addBridge(rhoPlatform.id.WM, function() {
|
1050
|
-
var
|
1050
|
+
var bridgeClass = typeof(WebkitBridge) !== "undefined" ? WebkitBridge : IEBridge;
|
1051
|
+
var bridge = new bridgeClass();
|
1051
1052
|
return {
|
1052
1053
|
apiCall: function (cmdText, async, resultHandler) {
|
1053
1054
|
var apiResult = bridge.framework(cmdText);
|
@@ -1056,6 +1057,7 @@ var Rho = Rho || (function ($) {
|
|
1056
1057
|
}
|
1057
1058
|
});
|
1058
1059
|
|
1060
|
+
|
1059
1061
|
addBridge(rhoPlatform.id.RHOSIMULATOR, function() {
|
1060
1062
|
return {
|
1061
1063
|
apiCall: function (cmdText, async, resultHandler) {
|
@@ -1096,6 +1098,7 @@ var Rho = Rho || (function ($) {
|
|
1096
1098
|
[/iPhone|iPod|iPad/ , bridges[rhoPlatform.id.IPHONE] ],
|
1097
1099
|
[/Windows\s+Phone/ , bridges[rhoPlatform.id.WP8] ],
|
1098
1100
|
[/Windows\s+(?:Mobile|CE)|WM [0-9]/, bridges[rhoPlatform.id.WM] ],
|
1101
|
+
[/MSIE/ , bridges[rhoPlatform.id.WM] ],
|
1099
1102
|
[/Windows/ , bridges[rhoPlatform.id.WIN32] ]
|
1100
1103
|
];
|
1101
1104
|
|
@@ -19,11 +19,10 @@ wp8:
|
|
19
19
|
project_paths:
|
20
20
|
wp8: ext/platform/wp8/Mediacapture.vcxproj
|
21
21
|
wm: ext/platform/wm/Mediacapture.vcproj
|
22
|
-
win32: ext/platform/wm/Mediacapture.vcproj
|
23
22
|
|
24
23
|
xml_api_paths: ext/camera.xml, ext/videocapture.xml
|
25
24
|
|
26
|
-
platforms: ["wm", "iphone", "android", "wp8"]
|
25
|
+
platforms: ["wm", "iphone", "android", "wp8", "win32"]
|
27
26
|
|
28
27
|
wm:
|
29
28
|
files:
|
@@ -0,0 +1,82 @@
|
|
1
|
+
QT += multimedia gui widgets multimediawidgets webkitwidgets core network webkit
|
2
|
+
|
3
|
+
TARGET = Mediacapture
|
4
|
+
TEMPLATE = lib
|
5
|
+
CONFIG += staticlib warn_on
|
6
|
+
|
7
|
+
isEmpty(RHODES_ROOT) {
|
8
|
+
RHODES_ROOT = ../../../../../..
|
9
|
+
}
|
10
|
+
|
11
|
+
INCLUDEPATH += \
|
12
|
+
$$RHODES_ROOT/lib/commonAPI/coreapi/ext/shared\
|
13
|
+
$$RHODES_ROOT/platform/shared/common\
|
14
|
+
$$RHODES_ROOT/platform/shared/rubyext\
|
15
|
+
$$RHODES_ROOT/platform/shared/ruby/include\
|
16
|
+
$$RHODES_ROOT/platform/shared\
|
17
|
+
../../shared\
|
18
|
+
|
19
|
+
macx {
|
20
|
+
DESTDIR = $$RHODES_ROOT/platform/osx/bin/extensions
|
21
|
+
OBJECTS_DIR = $$RHODES_ROOT/platform/osx/bin/extensions/mediacapture
|
22
|
+
INCLUDEPATH += $$RHODES_ROOT/platform/shared/ruby/iphone
|
23
|
+
}
|
24
|
+
win32 {
|
25
|
+
DESTDIR = $$RHODES_ROOT/platform/win32/bin/extensions
|
26
|
+
OBJECTS_DIR = $$RHODES_ROOT/platform/win32/bin/extensions/mediacapture
|
27
|
+
DEFINES += WIN32 _WINDOWS _LIB _UNICODE UNICODE
|
28
|
+
debug {
|
29
|
+
DEFINES += _DEBUG DEBUG
|
30
|
+
}
|
31
|
+
release {
|
32
|
+
DEFINES += _NDEBUG NDEBUG
|
33
|
+
}
|
34
|
+
INCLUDEPATH += $$RHODES_ROOT/platform/shared/ruby/win32
|
35
|
+
RCC_DIR = $$RHODES_ROOT/lib/commonAPI/mediacapture/ext/platform/qt/resources
|
36
|
+
}
|
37
|
+
|
38
|
+
DEFINES += RHODES_QT_PLATFORM _XOPEN_SOURCE _DARWIN_C_SOURCE
|
39
|
+
|
40
|
+
!isEmpty(RHOSIMULATOR_BUILD) {
|
41
|
+
DEFINES += RHODES_EMULATOR
|
42
|
+
}
|
43
|
+
|
44
|
+
!win32 {
|
45
|
+
QMAKE_CFLAGS_WARN_ON += -Wno-extra -Wno-unused -Wno-sign-compare -Wno-format -Wno-parentheses
|
46
|
+
QMAKE_CXXFLAGS_WARN_ON += -Wno-extra -Wno-unused -Wno-sign-compare -Wno-format -Wno-parentheses
|
47
|
+
}
|
48
|
+
win32 {
|
49
|
+
QMAKE_CFLAGS_WARN_ON += /wd4996 /wd4100 /wd4005
|
50
|
+
QMAKE_CXXFLAGS_WARN_ON += /wd4996 /wd4100 /wd4005
|
51
|
+
QMAKE_CFLAGS_RELEASE += /O2
|
52
|
+
QMAKE_CXXFLAGS_RELEASE += /O2
|
53
|
+
|
54
|
+
QMAKE_CXXFLAGS_RELEASE += -MP9
|
55
|
+
QMAKE_CXXFLAGS_DEBUG += -MP9
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
HEADERS += \
|
61
|
+
..\..\shared\generated\cpp\ICamera.h\
|
62
|
+
..\..\shared\generated\cpp\CameraBase.h \
|
63
|
+
src/CCameraData.h \
|
64
|
+
src/ImageFileNameGetter.h \
|
65
|
+
src/ImageFilenameGetterResult.h \
|
66
|
+
src/CameraDialogController.h \
|
67
|
+
src/CameraDialogView.h \
|
68
|
+
src/CameraDialogBuilder.h
|
69
|
+
|
70
|
+
SOURCES += \
|
71
|
+
..\..\shared\MediacaptureInit.cpp\
|
72
|
+
..\..\shared\generated\cpp\Camera_js_wrap.cpp\
|
73
|
+
..\..\shared\generated\cpp\Camera_ruby_wrap.cpp\
|
74
|
+
..\..\shared\generated\cpp\CameraBase.cpp\
|
75
|
+
..\..\shared\generated\Camera_api_init.cpp\
|
76
|
+
..\..\shared\generated\Camera_js_api.cpp\
|
77
|
+
..\..\shared\generated\Camera_ruby_api.c\
|
78
|
+
src\Camera_impl.cpp \
|
79
|
+
src/CCameraData.cpp \
|
80
|
+
src/CameraDialogView.cpp
|
81
|
+
|
82
|
+
RESOURCES += $$RHODES_ROOT/lib/commonAPI/mediacapture/ext/platform/qt/resources/mediacapture.qrc
|
@@ -0,0 +1,35 @@
|
|
1
|
+
def build_extension(name)
|
2
|
+
require File.join($rootdir, 'lib/build/jake.rb')
|
3
|
+
args = ['-o', 'Makefile', '-r', '-spec', $qmake_spec, "#{name}.pro", 'CONFIG-=debug', 'CONFIG+=release', 'CONFIG+=no_fixpath', "RHODES_ROOT='#{$rootdir}'", $qmakevars]
|
4
|
+
puts Jake.run($qmake,args)
|
5
|
+
fail "[qmake #{name}.pro]" unless $? == 0
|
6
|
+
#puts Jake.run($make, ['clean'])
|
7
|
+
fail "[make clean]" unless $? == 0
|
8
|
+
puts Jake.run($make, ['all'])
|
9
|
+
fail "[make all]" unless $? == 0
|
10
|
+
end
|
11
|
+
|
12
|
+
namespace "build" do
|
13
|
+
task :config do
|
14
|
+
$platform = ENV['RHO_PLATFORM']
|
15
|
+
raise "RHO_PLATFORM is not set" if $platform.nil?
|
16
|
+
$rootdir = ENV['RHO_ROOT']
|
17
|
+
raise "RHO_ROOT is not set" if $rootdir.nil?
|
18
|
+
$qmake = ENV['RHO_QMAKE']
|
19
|
+
raise "RHO_QMAKE is not set" if $qmake.nil?
|
20
|
+
$qmake_spec = ENV['RHO_QMAKE_SPEC']
|
21
|
+
raise "RHO_QMAKE_SPEC is not set" if $qmake_spec.nil?
|
22
|
+
$qmakevars = ENV['RHO_QMAKE_VARS']
|
23
|
+
if $platform == 'win32'
|
24
|
+
$make = 'nmake'
|
25
|
+
else
|
26
|
+
$make = 'make'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
task :all => :config do
|
31
|
+
build_extension('Mediacapture')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
task :default => "build:all"
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,83 @@
|
|
1
|
+
#include "CCameraData.h"
|
2
|
+
|
3
|
+
QHash<QString, CCameraData *> CCameraData::camerasKeeper;
|
4
|
+
|
5
|
+
QMutex *CCameraData::getMutex()
|
6
|
+
{
|
7
|
+
static QMutex mutex;
|
8
|
+
return & mutex;
|
9
|
+
}
|
10
|
+
CCameraData::CCameraData():CameraDialogController(0)
|
11
|
+
{
|
12
|
+
cameraType.clear();
|
13
|
+
cameraID.clear();
|
14
|
+
}
|
15
|
+
|
16
|
+
const QString CCameraData::getCameraType() const
|
17
|
+
{
|
18
|
+
return cameraType;
|
19
|
+
}
|
20
|
+
|
21
|
+
const QString CCameraData::getCameraID() const
|
22
|
+
{
|
23
|
+
return cameraID;
|
24
|
+
}
|
25
|
+
|
26
|
+
const QList<QString> CCameraData::getKeys()
|
27
|
+
{
|
28
|
+
return camerasKeeper.keys();
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
const CCameraData *CCameraData::addNewCamera(QCameraInfo &info){
|
33
|
+
CCameraData * data = new CCameraData(info);
|
34
|
+
camerasKeeper.insert(data->getCameraID(), data);
|
35
|
+
return data;
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
void CCameraData::cleanAll(){
|
40
|
+
QMutexLocker locker(getMutex());
|
41
|
+
foreach (CCameraData * cameraData, camerasKeeper) {
|
42
|
+
cameraData->deleteLater();
|
43
|
+
camerasKeeper.clear();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
|
47
|
+
const bool CCameraData::isEmpty()
|
48
|
+
{
|
49
|
+
return camerasKeeper.isEmpty();
|
50
|
+
}
|
51
|
+
|
52
|
+
CCameraData *CCameraData::getCameraData(QString &ID)
|
53
|
+
{
|
54
|
+
QMutexLocker locker(getMutex());
|
55
|
+
if(camerasKeeper.contains(ID)){return camerasKeeper.value(ID);
|
56
|
+
}else{return nullptr;}
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
CCameraData::CCameraData(QCameraInfo &info):CameraDialogController(0){
|
61
|
+
this->info = info;
|
62
|
+
cameraID = QString::number(camerasKeeper.size() + 1);
|
63
|
+
if (info.position() == QCamera::BackFace){cameraType = "back";}
|
64
|
+
else{cameraType = "front";}
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
void CCameraData::showView(rho::apiGenerator::CMethodResult &oResult)
|
69
|
+
{
|
70
|
+
if (dialogExists()) return;
|
71
|
+
CameraDialogBuilder * builder = new CameraDialogBuilder(this, info, oResult, getQMainWindow());
|
72
|
+
emit builder->run();
|
73
|
+
}
|
74
|
+
|
75
|
+
QtMainWindow *CCameraData::getQMainWindow()
|
76
|
+
{
|
77
|
+
return ((QtMainWindow *) CMainWindow::getInstance()->getQtMainWindow());
|
78
|
+
}
|
79
|
+
|
80
|
+
void CCameraData::choosePicture(rho::apiGenerator::CMethodResult& oResult) {
|
81
|
+
ImageFileNameGetter * getter = new ImageFileNameGetter(QThread::currentThread(),oResult,getQMainWindow());
|
82
|
+
getter->run();
|
83
|
+
}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#ifndef CCAMERADATA_H
|
2
|
+
#define CCAMERADATA_H
|
3
|
+
#include <QObject>
|
4
|
+
#include <QCameraInfo>
|
5
|
+
#include <QCamera>
|
6
|
+
#include <QMultimedia>
|
7
|
+
#include <QMediaRecorder>
|
8
|
+
#include <QCameraImageCapture>
|
9
|
+
#include <QEventLoopLocker>
|
10
|
+
#include <QThread>
|
11
|
+
#include <QMutex>
|
12
|
+
#include <QMutexLocker>
|
13
|
+
#include "../../platform/shared/qt/rhodes/QtMainWindow.h"
|
14
|
+
#include "../../platform/shared/qt/rhodes/impl/MainWindowImpl.h"
|
15
|
+
#include "../../platform/shared/qt/rhodes/iexecutable.h"
|
16
|
+
#include "ImageFileNameGetter.h"
|
17
|
+
#include "CameraDialogController.h"
|
18
|
+
#include "CameraDialogBuilder.h"
|
19
|
+
|
20
|
+
class CCameraData : public CameraDialogController{
|
21
|
+
Q_OBJECT
|
22
|
+
private:
|
23
|
+
QString cameraType;
|
24
|
+
QString cameraID;
|
25
|
+
QCameraInfo info;
|
26
|
+
|
27
|
+
CCameraData();
|
28
|
+
CCameraData(QCameraInfo &info);
|
29
|
+
|
30
|
+
static QHash<QString, CCameraData *> camerasKeeper;
|
31
|
+
|
32
|
+
public:
|
33
|
+
~CCameraData() {cleanAll();}
|
34
|
+
static const CCameraData *addNewCamera(QCameraInfo &info);
|
35
|
+
static void cleanAll();
|
36
|
+
static const QList<QString> getKeys();
|
37
|
+
static const bool isEmpty();
|
38
|
+
static CCameraData *getCameraData(QString &ID);
|
39
|
+
|
40
|
+
const QString getCameraType() const;
|
41
|
+
const QString getCameraID() const;
|
42
|
+
|
43
|
+
void takeAPicture(rho::apiGenerator::CMethodResult &oResult);
|
44
|
+
static QMutex * getMutex();
|
45
|
+
|
46
|
+
void showView(rho::apiGenerator::CMethodResult &oResult);
|
47
|
+
static QtMainWindow *getQMainWindow();
|
48
|
+
static void choosePicture(rho::apiGenerator::CMethodResult &oResult);
|
49
|
+
public slots:
|
50
|
+
|
51
|
+
|
52
|
+
};
|
53
|
+
|
54
|
+
#endif // CCAMERADATA_H
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#ifndef CAMERADIALOGBUILDER_H
|
2
|
+
#define CAMERADIALOGBUILDER_H
|
3
|
+
|
4
|
+
#include "../../platform/shared/qt/rhodes/iexecutable.h"
|
5
|
+
#include "CameraDialogView.h"
|
6
|
+
#include "CameraDialogController.h"
|
7
|
+
|
8
|
+
class CameraDialogBuilder : public IExecutable
|
9
|
+
{
|
10
|
+
Q_OBJECT
|
11
|
+
private:
|
12
|
+
CameraDialogController * controller;
|
13
|
+
QCameraInfo info;
|
14
|
+
QWidget * parentWidget;
|
15
|
+
rho::apiGenerator::CMethodResult oResult;
|
16
|
+
public:
|
17
|
+
explicit CameraDialogBuilder(CameraDialogController * controller, QCameraInfo &info,
|
18
|
+
rho::apiGenerator::CMethodResult &oResult, QWidget *parent) : IExecutable(parent){
|
19
|
+
this->controller = controller;
|
20
|
+
this->info = info;
|
21
|
+
this->oResult = oResult;
|
22
|
+
parentWidget = parent;
|
23
|
+
}
|
24
|
+
|
25
|
+
public slots:
|
26
|
+
void execute(){
|
27
|
+
CameraDialogView * dialog = new CameraDialogView(info, oResult, controller, parentWidget);
|
28
|
+
connect(parentWidget, SIGNAL(destroyed(QObject*)), dialog, SLOT(reject()));
|
29
|
+
connect(parentWidget, SIGNAL(destroyed(QObject*)), dialog, SLOT(deleteLater()));
|
30
|
+
dialog->show();
|
31
|
+
controller->setDialogExists();
|
32
|
+
deleteLater();
|
33
|
+
}
|
34
|
+
};
|
35
|
+
|
36
|
+
#endif // CAMERADIALOGBUILDER_H
|
@@ -0,0 +1,31 @@
|
|
1
|
+
#ifndef CAMERADIALOGCONTROLLER_H
|
2
|
+
#define CAMERADIALOGCONTROLLER_H
|
3
|
+
|
4
|
+
#include <QObject>
|
5
|
+
#include <QDebug>
|
6
|
+
#include <QMutex>
|
7
|
+
#include <QMutexLocker>
|
8
|
+
|
9
|
+
class CameraDialogController : public QObject
|
10
|
+
{
|
11
|
+
Q_OBJECT
|
12
|
+
protected:
|
13
|
+
volatile bool exists;
|
14
|
+
QMutex mutex;
|
15
|
+
|
16
|
+
public:
|
17
|
+
explicit CameraDialogController(QObject *parent):QObject(parent){
|
18
|
+
exists = false;
|
19
|
+
}
|
20
|
+
virtual ~CameraDialogController(){
|
21
|
+
|
22
|
+
}
|
23
|
+
|
24
|
+
volatile bool dialogExists(){return exists;}
|
25
|
+
public slots:
|
26
|
+
void setDialogExists(){exists = true;}
|
27
|
+
void setDialogRejected(){exists = false;}
|
28
|
+
|
29
|
+
};
|
30
|
+
|
31
|
+
#endif // CAMERADIALOGCONTROLLER_H
|
@@ -0,0 +1,73 @@
|
|
1
|
+
#ifndef CAMERADIALOGVIEW_H
|
2
|
+
#define CAMERADIALOGVIEW_H
|
3
|
+
|
4
|
+
#include <QDialog>
|
5
|
+
#include <QCamera>
|
6
|
+
#include <QVBoxLayout>
|
7
|
+
#include <QDebug>
|
8
|
+
#include <QVideoWidget>
|
9
|
+
#include <QEventLoop>
|
10
|
+
#include <QThread>
|
11
|
+
#include <QDebug>
|
12
|
+
#include <QFileInfo>
|
13
|
+
#include <QCameraFocus>
|
14
|
+
#include <QCameraExposure>
|
15
|
+
#include <QImageEncoderSettings>
|
16
|
+
#include <QDir>
|
17
|
+
#include <QCameraImageCapture>
|
18
|
+
#include <QCameraInfo>
|
19
|
+
#include <QPushButton>
|
20
|
+
#include <QImage>
|
21
|
+
#include <QPixmap>
|
22
|
+
#include <QLabel>
|
23
|
+
#include <QHBoxLayout>
|
24
|
+
#include <QTime>
|
25
|
+
#include <QDate>
|
26
|
+
#include <QTimer>
|
27
|
+
#include <QIcon>
|
28
|
+
#include "../../../../../platform/shared/api_generator/MethodResult.h"
|
29
|
+
#include "../../../../../platform/shared/common/RhoStd.h"
|
30
|
+
#include "../../platform/shared/qt/rhodes/QtMainWindow.h"
|
31
|
+
#include "../../platform/shared/qt/rhodes/impl/MainWindowImpl.h"
|
32
|
+
#include "../../platform/shared/qt/rhodes/iexecutable.h"
|
33
|
+
#include "CameraDialogController.h"
|
34
|
+
#include <QtPlugin>
|
35
|
+
#include <QPluginLoader>
|
36
|
+
#include <QJsonObject>
|
37
|
+
|
38
|
+
|
39
|
+
class CameraDialogView : public QDialog
|
40
|
+
{
|
41
|
+
Q_OBJECT
|
42
|
+
public:
|
43
|
+
explicit CameraDialogView(QCameraInfo & info, rho::apiGenerator::CMethodResult &oResult,
|
44
|
+
CameraDialogController * controller, QWidget *parent);
|
45
|
+
~CameraDialogView();
|
46
|
+
|
47
|
+
static void getImageData(rho::Hashtable<rho::String, rho::String> & mapRes, const QString &fileNameToOpen);
|
48
|
+
static QDir getImageDir();
|
49
|
+
private:
|
50
|
+
QVideoWidget * videoWidget;
|
51
|
+
rho::apiGenerator::CMethodResult oResult;
|
52
|
+
QCameraImageCapture * imageCapture;
|
53
|
+
QCamera * camera;
|
54
|
+
CameraDialogController * controller;
|
55
|
+
QLabel * laPreview;
|
56
|
+
QImage currentImage;
|
57
|
+
bool imageIsSaved;
|
58
|
+
QTimer timerToRestoreCaptureButtonImage;
|
59
|
+
QIcon imageCaptureClose;
|
60
|
+
QIcon imageCaptureOpened;
|
61
|
+
QIcon imageSave;
|
62
|
+
QPushButton * buttonCapture;
|
63
|
+
public slots:
|
64
|
+
void imageSaved(int id, const QString &fileName);
|
65
|
+
void error();
|
66
|
+
void capture();
|
67
|
+
void imageCaptured(int id, const QImage &preview);
|
68
|
+
void saveCurrentImage();
|
69
|
+
void restoreCaptureButtonImage();
|
70
|
+
|
71
|
+
};
|
72
|
+
|
73
|
+
#endif // CAMERADIALOGVIEW_H
|