incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From long...@apache.org
Subject [1/2] qt commit: added camera symbian support in pro
Date Mon, 02 Apr 2012 15:14:12 GMT
Updated Branches:
  refs/heads/master 9f7439ed1 -> e8670eac8


added camera symbian support in pro


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/commit/e8670eac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/tree/e8670eac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/diff/e8670eac

Branch: refs/heads/master
Commit: e8670eac8d3dd897a393923f5fef34d77769880c
Parents: fee4e82
Author: Longwei Su <longwei.su@gmail.com>
Authored: Fri Mar 30 16:16:59 2012 -0400
Committer: Longwei Su <longwei.su@gmail.com>
Committed: Fri Mar 30 16:16:59 2012 -0400

----------------------------------------------------------------------
 cordovaqt.desktop            |   11 -----------
 cordovaqt.pro                |   13 +++++++++----
 cordovaqt_harmattan.desktop  |   11 -----------
 src/plugins/notification.cpp |   10 +++++-----
 www/basic.js                 |   17 +++++++++++++++++
 www/index.html               |    4 ++++
 xml/plugins.xml              |    1 +
 7 files changed, 36 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/cordovaqt.desktop
----------------------------------------------------------------------
diff --git a/cordovaqt.desktop b/cordovaqt.desktop
deleted file mode 100644
index 13b4574..0000000
--- a/cordovaqt.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=cordova-qt
-Exec=/opt/cordova-qt/bin/cordova-qt
-Icon=cordova-qt64
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/cordovaqt.pro
----------------------------------------------------------------------
diff --git a/cordovaqt.pro b/cordovaqt.pro
index 17e0295..7f03860 100644
--- a/cordovaqt.pro
+++ b/cordovaqt.pro
@@ -22,7 +22,9 @@ SOURCES += main.cpp \
     src/plugins/events.cpp \
     src/cordova.cpp \
     src/cplugin.cpp \
-    src/plugins/contacts.cpp
+    src/plugins/contacts.cpp \
+    src/plugins/camera.cpp
+    
 HEADERS += \
     src/plugins/notification.h \
     src/plugins/geolocation.h \
@@ -36,7 +38,9 @@ HEADERS += \
     src/plugins/events.h \
     src/cordova.h \
     src/cplugin.h \
-    src/plugins/contacts.h
+    src/plugins/contacts.h \
+    src/plugins/camera.h \
+    src/plugins/cameraresolution.h
 
 greaterThan(QT_MAJOR_VERSION, 4) {
     message("Qt5 build")
@@ -60,7 +64,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
     OTHER_FILES += qml/main_harmattan.qml \
         qml/cordova_wrapper.js
 
-    QT += declarative
+    QT += declarative dbus
     QT += webkit
     CONFIG += mobility qdeclarative-boostable
     MOBILITY += feedback location systeminfo sensors multimedia contacts
@@ -73,7 +77,8 @@ greaterThan(QT_MAJOR_VERSION, 4) {
 
     symbian:TARGET.UID3 = 0xE3522943
     #symbian:DEPLOYMENT.installer_header = 0x2002CCCF
-    symbian:TARGET.CAPABILITY += NetworkServices
+    symbian:TARGET.CAPABILITY += NetworkServices UserEnvironment
+    symbian:{LIBS += -lecam -lServiceHandler -lnewservice -lbafl}
 
     QT += declarative
     QT += webkit

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/cordovaqt_harmattan.desktop
----------------------------------------------------------------------
diff --git a/cordovaqt_harmattan.desktop b/cordovaqt_harmattan.desktop
deleted file mode 100644
index 3c89310..0000000
--- a/cordovaqt_harmattan.desktop
+++ /dev/null
@@ -1,11 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-Version=1.0
-Type=Application
-Terminal=false
-Name=cordova-qt
-Exec=/usr/bin/invoker --type=d -s /opt/cordovaqt/bin/cordovaqt
-Icon=/usr/share/icons/hicolor/80x80/apps/cordovaqt80.png
-X-Window-Icon=
-X-HildonDesk-ShowInToolbar=true
-X-Osso-Type=application/x-executable

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/src/plugins/notification.cpp
----------------------------------------------------------------------
diff --git a/src/plugins/notification.cpp b/src/plugins/notification.cpp
index e9bd385..e8d0f84 100644
--- a/src/plugins/notification.cpp
+++ b/src/plugins/notification.cpp
@@ -21,11 +21,11 @@
 #include <QApplication>
 #include <QFeedbackHapticsEffect>
 
-#if QT_VERSION < 0x050000
-# include <QtMultimediaKit/QMediaPlayer>
-#else
-# include <QtMultimedia/QMediaPlayer>
-#endif
+//#if QT_VERSION < 0x050000
+# include <QMediaPlayer>
+//#else
+//# include <QtMultimedia/QMediaPlayer>
+//#endif
 #include <QDebug>
 
 #ifdef QTM_NAMESPACE

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/www/basic.js
----------------------------------------------------------------------
diff --git a/www/basic.js b/www/basic.js
index 9ade80b..14605ac 100644
--- a/www/basic.js
+++ b/www/basic.js
@@ -110,6 +110,23 @@ function getCurrentAcceleration() {
 
 }
 
+function getPicture(){
+    navigator.camera.getPicture(function(picture_file){
+                                    console.log("getPicture succeed callback: "+picture_file)
+                                    get("picture_val").innerHTML = '<img width="200" src="'
+ picture_file +'" />';
+                                },
+                                function(){
+                                    console.log("getPicture error callback")
+                                    get("picture_val").innerHTML = 'Capture cancelled or
error occured'
+                                },
+                                { quality : 75,
+                                  destinationType : Camera.DestinationType.DATA_URL,
+                                  sourceType : Camera.PictureSourceType.CAMERA,
+                                  allowEdit : true,
+                                  encodingType: Camera.EncodingType.JPEG,
+                                  targetWidth: 100,
+                                  targetHeight: 100});
+}
 
 
 function test_requestFileSystem() {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/www/index.html
----------------------------------------------------------------------
diff --git a/www/index.html b/www/index.html
index e911300..34f3dd6 100644
--- a/www/index.html
+++ b/www/index.html
@@ -14,6 +14,7 @@
         <script language="javascript" type="text/javascript" src="js/notification.js"></script>
         <script language="javascript" type="text/javascript" src="js/compass.js"></script>
         <script language="javascript" type="text/javascript" src="js/accelerometer.js"></script>
+        <script language="javascript" type="text/javascript" src="js/camera.js"></script>
         <script language="javascript" type="text/javascript" src="js/contacts.js"></script>
 
         <script language="javascript" type="text/javascript" src="basic.js"></script>
@@ -46,6 +47,9 @@
         <input type="button" value="Get Current Heading" onclick="getCurrentHeading();">
         <br />
         <div id="heading_val"> Heading </div>
+        <input type="button" value="Get Picture" onclick="getPicture();">
+        <br />
+        <div id="picture_val"> Picture</div>
         <input type="button" value="Create Test Contact" onclick="createTestContact();">
         <br />
         <div id="create_contact_result"></div>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-qt/blob/e8670eac/xml/plugins.xml
----------------------------------------------------------------------
diff --git a/xml/plugins.xml b/xml/plugins.xml
index c6da722..5bd65da 100644
--- a/xml/plugins.xml
+++ b/xml/plugins.xml
@@ -9,6 +9,7 @@
     <plugin name="Console" value="com.cordova.Console"/>
     <plugin name="Connection" value="com.cordova.Connection"/>
     <plugin name="Compass" value="com.cordova.Compass"/>
+    <plugin name="Camera" value="com.cordova.Camera"/>
     <plugin name="Contacts" value="com.cordova.Contacts"/>
 
 <!--    <plugin name="Compass" value="com.cordova.CompassListener"/>


Mime
View raw message