cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/4] git commit: add ubuntu platform
Date Thu, 05 Dec 2013 00:56:13 GMT
Updated Branches:
  refs/heads/master eae4edbcb -> 6f488ccf5


add ubuntu platform


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/commit/68e28df6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/tree/68e28df6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/diff/68e28df6

Branch: refs/heads/master
Commit: 68e28df6c55b5a90d1ce79b3a09968f9ea12d4be
Parents: 8db4f6d
Author: Maxim Ermilov <maxim.ermilov@canonical.com>
Authored: Tue Oct 8 11:34:44 2013 +0400
Committer: Maxim Ermilov <maxim.ermilov@canonical.com>
Committed: Tue Oct 8 11:34:44 2013 +0400

----------------------------------------------------------------------
 plugin.xml             | 15 +++++++++++++++
 src/ubuntu/console.cpp | 29 +++++++++++++++++++++++++++++
 src/ubuntu/console.h   | 43 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/68e28df6/plugin.xml
----------------------------------------------------------------------
diff --git a/plugin.xml b/plugin.xml
index 49fcf83..4d012e0 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -31,6 +31,21 @@
 
     </platform>
 
+    <!-- ubuntu -->
+    <platform name="ubuntu">
+        <js-module src="www/console-via-logger.js" name="console">
+            <clobbers target="console" />
+        </js-module>
+
+        <js-module src="www/logger.js" name="logger">
+            <clobbers target="cordova.logger" />
+        </js-module>
+
+        <header-file src="src/ubuntu/console.h" />
+        <source-file src="src/ubuntu/console.cpp" />
+
+    </platform>
+
     <!-- wp7 -->
     <platform name="wp7">
         <config-file target="config.xml" parent="/*">

http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/68e28df6/src/ubuntu/console.cpp
----------------------------------------------------------------------
diff --git a/src/ubuntu/console.cpp b/src/ubuntu/console.cpp
new file mode 100644
index 0000000..9de09f4
--- /dev/null
+++ b/src/ubuntu/console.cpp
@@ -0,0 +1,29 @@
+/*
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#include "console.h"
+
+#include <iostream>
+
+Console::Console(Cordova *cordova) : CPlugin(cordova) {
+}
+
+void Console::logLevel(int scId, int ecId, QString level, QString message) {
+    Q_UNUSED(scId)
+    Q_UNUSED(ecId)
+
+    if (level != "LOG")
+      std::cout << "[" << level.toStdString() << "] ";
+    std::cout << message.toStdString() << std::endl;
+}

http://git-wip-us.apache.org/repos/asf/cordova-plugin-console/blob/68e28df6/src/ubuntu/console.h
----------------------------------------------------------------------
diff --git a/src/ubuntu/console.h b/src/ubuntu/console.h
new file mode 100644
index 0000000..3f3d163
--- /dev/null
+++ b/src/ubuntu/console.h
@@ -0,0 +1,43 @@
+/*
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#ifndef CONSOLE_H_FDSVCXGFRS
+#define CONSOLE_H_FDSVCXGFRS
+
+#include <cplugin.h>
+
+#include <QtCore>
+
+class Console : public CPlugin {
+    Q_OBJECT
+public:
+    explicit Console(Cordova *cordova);
+
+    virtual const QString fullName() override {
+        return Console::fullID();
+    }
+
+    virtual const QString shortName() override {
+        return "Console";
+    }
+
+    static const QString fullID() {
+        return "Console";
+    }
+
+public slots:
+    void logLevel(int scId, int ecId, QString level, QString message);
+};
+
+#endif


Mime
View raw message