corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject incubator-corinthia git commit: first test appl, getting ready to port the work of peter
Date Sun, 16 Aug 2015 10:23:15 GMT
Repository: incubator-corinthia
Updated Branches:
  refs/heads/editorFramework 6e55afa37 -> 097b025ba


first test appl, getting ready to port the work of peter


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/097b025b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/097b025b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/097b025b

Branch: refs/heads/editorFramework
Commit: 097b025ba6ac5ebddcd32a542d34946b9ac7e154
Parents: 6e55afa
Author: jani <jani@apache.org>
Authored: Sun Aug 16 12:23:00 2015 +0200
Committer: jani <jani@apache.org>
Committed: Sun Aug 16 12:23:00 2015 +0200

----------------------------------------------------------------------
 .../src/Layer1_toolkit/qt/qt_toolkit.cpp        | 38 ++++++++++++++++++--
 .../src/Layer1_toolkit/qt/qt_toolkit.hpp        | 11 ++++--
 .../src/Layer1_toolkit/toolkit.hpp              | 16 ++++++---
 3 files changed, 55 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/097b025b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
index 132ed8f..33c195e 100644
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
+++ b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.cpp
@@ -6,8 +6,7 @@
 // "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
-//
+//   http://www.apache.org/licenses/LICENSE-2.//
 // 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
@@ -16,7 +15,40 @@
 // under the License.
 
 #pragma once
-#include <QtWidgets/QApplication>
 #include "windows.hpp"
 #include "qt_toolkit.hpp"
+toolkit * toolkit::createInstance(toolkit_callback *tk, int debug_level) {
+    return (toolkit *)new qt_toolkit();
+}
+
+
+
+bool qt_toolkit::startWindow() {
+    int    argc = 0;
+    char **argv = NULL;
+
+    app    = new QApplication(argc, argv);
+    window = new MainWindow(app);
+    return true;
+}
+
+
+
+void qt_toolkit::run() {
+    window->show();
+    app->exec();
+}
+
+
+
+bool qt_toolkit::callJavascript(const char *function) {
+    return true;
+}
+
+
+
+#if 0
+{
+}
 
+#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/097b025b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
index e570d7d..3d4804a 100644
--- a/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
+++ b/experiments/editorFramework/src/Layer1_toolkit/qt/qt_toolkit.hpp
@@ -17,6 +17,7 @@
 
 #pragma once
 #include "../toolkit.hpp"
+#include <QtWidgets/QApplication>
 
 /*
  * Implementation of toolkit generic interface in Qt
@@ -29,9 +30,15 @@ class qt_toolkit : toolkit
     /* toolkit qt implementation */
 
 public:
+    /* Inherited functions */
+    bool startWindow();
+    void run();
+    bool callJavascript(const char *function);
 
 private: 
-    QApplication *app;
-    MainWindow   *window;
+    static QApplication     *app;
+    static MainWindow       *window;
+    static toolkit_callback *callback;
+    static int               debugLevel;
 };
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/097b025b/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
----------------------------------------------------------------------
diff --git a/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp b/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
index 6d826f1..507ffc0 100644
--- a/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
+++ b/experiments/editorFramework/src/Layer1_toolkit/toolkit.hpp
@@ -102,15 +102,21 @@ class toolkit
 
 public:
     // Create instance
-    static const int DEBUG_INFO;
-    static const int DEBUG_WARNING;
-    static const int DEBUG_DEBUG;
-    static const int DEBUG_ERROR;
-    static toolkit *createInstance(toolkit_callback& callback, int debugLevel);
+    static const enum {
+        DEBUG_NONE,
+        DEBUG_INFO,
+        DEBUG_WARNING,
+        DEBUG_DEBUG,
+        DEBUG_ERROR
+    };
+    static toolkit *createInstance(toolkit_callback *callback, int debugLevel);
 
     // Start windows etc
     virtual bool startWindow() = 0;
 
+    // Start message loop
+    virtual void run() = 0;
+
     // Start Javascript
     virtual bool callJavascript(const char *function) = 0;
 };


Mime
View raw message