[mcrux] r156 committed - Spiking out QtWindow widget.

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 5, 2009, 8:39:43 PM11/5/09
to mcru...@googlegroups.com
Revision: 156
Author: mital.d.vora
Date: Thu Nov 5 17:39:05 2009
Log: Spiking out QtWindow widget.


http://code.google.com/p/mcrux/source/detail?r=156

Added:
/trunk/src/lib/abstract/Makefile.am
/trunk/src/lib/window/MCruxQTWindow.cpp
/trunk/src/lib/window/MCruxQTWindow.h
/trunk/src/src.pro
Modified:
/trunk/src/lib/MCrux.cpp
/trunk/src/lib/window/MCruxWindowConfiguration.h
/trunk/src/lib/window/MCruxWindowManager.cpp
/trunk/src/lib/window/Makefile.am

=======================================
--- /dev/null
+++ /trunk/src/lib/abstract/Makefile.am Thu Nov 5 17:39:05 2009
@@ -0,0 +1,14 @@
+## Process this file with automake to produce Makefile.in
+
+INCLUDES = -I@top_srcdir@/lib
+
+SUBDIRS = .
+
+noinst_HEADERS = \
+ MCruxWindow.h
+
+lib_LTLIBRARIES = libmcrux_abstract.la
+
+libmcrux_abstract_la_SOURCES = \
+ MCruxWindow.cpp
+
=======================================
--- /dev/null
+++ /trunk/src/lib/window/MCruxQTWindow.cpp Thu Nov 5 17:39:05 2009
@@ -0,0 +1,56 @@
+/**
+ * copyright (C) 2009 Mital Vora. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of MCrux nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * @author: Mital Vora.
+ **/
+
+#include <string>
+using namespace std;
+#include "MCruxQTWindow.h"
+
+
+MCruxQTWindow::MCruxQTWindow(const MCruxWindowConfiguration * _config)
+ : MCruxWindow(_config)
+{
+ this->show();
+}
+
+
+MCruxQTWindow::~MCruxQTWindow()
+{
+}
+
+int MCruxQTWindow::ShowWindow() const
+{
+ return -1;
+}
+
+
+int MCruxQTWindow::HideWindow() const
+{
+ return -1;
+}
+
+
+int MCruxQTWindow::UpdateWindow() const
+{
+ return -1;
+}
+
+
+void MCruxQTWindow::resize() const
+{
+}
=======================================
--- /dev/null
+++ /trunk/src/lib/window/MCruxQTWindow.h Thu Nov 5 17:39:05 2009
@@ -0,0 +1,56 @@
+/**
+ * copyright (C) 2009 Mital Vora. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of MCrux nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * @author: Mital Vora.
+ **/
+
+#ifndef _MCRUXQTWINDOW_H_
+#define _MCRUXQTWINDOW_H_
+
+#include <QtGui/QtGui>
+#include <abstract/MCruxWindow.h>
+#include <window/MCruxWindowConfiguration.h>
+
+//#include "MCruxWebView.h"
+//#include "plugin/MCruxPluginManager.h"
+
+
+class MCruxQTWindow
+ : public QWidget,
+ public MCruxWindow
+{
+#ifdef WIN32
+private:
+ // webView
+ MCruxWebView webView;
+#else
+ Q_OBJECT
+
+ // TODO: Add Qwebview class
+#endif
+
+public:
+
+ MCruxQTWindow(const MCruxWindowConfiguration * _config);
+ virtual ~MCruxQTWindow();
+
+ virtual int ShowWindow() const;
+ virtual int HideWindow() const;
+ virtual int UpdateWindow() const;
+ virtual void resize() const;
+};
+
+#endif // _MCRUXQTWINDOW_H_
=======================================
--- /dev/null
+++ /trunk/src/src.pro Thu Nov 5 17:39:05 2009
@@ -0,0 +1,33 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Wed Nov 4 17:31:02 2009
+######################################################################
+
+TEMPLATE = app
+TARGET = mcrux.bin
+LIBS += -lxml2
+DEPENDPATH += . \
+ /usr/include/libxml2 \
+ bin \
+ lib \
+ include
+INCLUDEPATH += . \
+ /usr/include/libxml2 \
+ lib \
+ include
+
+# Input
+HEADERS += lib/MCruxSpecParser.h \
+ lib/MCruxWebView.h \
+ include/mcrux/MCrux.h \
+ lib/abstract/MCruxWindow.h \
+ lib/window/MCruxQTWindow.h \
+ lib/window/MCruxWindowConfiguration.h \
+ lib/window/MCruxWindowManager.h \
+ include/mcrux/abstract/callback.h
+SOURCES += bin/mcrux_linux.cpp \
+ lib/MCrux.cpp \
+ lib/MCruxSpecParser.cpp \
+ lib/abstract/MCruxWindow.cpp \
+ lib/window/MCruxQTWindow.cpp \
+ lib/window/MCruxWindowConfiguration.cpp \
+ lib/window/MCruxWindowManager.cpp
=======================================
--- /trunk/src/lib/MCrux.cpp Sun Nov 1 06:09:27 2009
+++ /trunk/src/lib/MCrux.cpp Thu Nov 5 17:39:05 2009
@@ -57,7 +57,7 @@


#else // for linux
-#include <gtk/gtk.h>
+#include <QtGui/QtGui>
#endif

MCrux::MCrux()
@@ -88,9 +88,9 @@
// Init COM
OleInitialize(NULL);
#else
- gtk_init (&argc, &argv);
- if (!g_thread_supported ())
- g_thread_init (NULL);
+ //gtk_init (&argc, &argv);
+ //if (!g_thread_supported ())
+ //g_thread_init (NULL);

#endif
}
@@ -113,11 +113,11 @@
)
{
bool bRet = false;
- Initialize(
-#ifndef WIN32
- argc, argv
+#ifdef WIN32
+ Initialize();
+#else
+ QApplication app(argc, argv);
#endif
- );

// parse the given configuration file
MCruxSpecParser parser;
@@ -156,8 +156,9 @@
}
bRet = true;
#else // for linux
- gtk_main();
-
+ // gtk_main();
+
+ return app.exec();
#endif
}
else
@@ -170,6 +171,8 @@
#endif
}

+#ifdef WIN32
UnInitialize();
+#endif
return bRet;
}
=======================================
--- /trunk/src/lib/window/MCruxWindowConfiguration.h Sun Nov 1 00:06:50
2009
+++ /trunk/src/lib/window/MCruxWindowConfiguration.h Thu Nov 5 17:39:05
2009
@@ -24,8 +24,11 @@

using namespace std;

+#ifdef WIN32
#include <webkit/webkit.h>
-
+#else
+#include <QtWebKit/QtWebKit>
+#endif
class MCruxWindowConfiguration
{
const wstring windowTitle;
=======================================
--- /trunk/src/lib/window/MCruxWindowManager.cpp Sun Nov 1 05:42:59 2009
+++ /trunk/src/lib/window/MCruxWindowManager.cpp Thu Nov 5 17:39:05 2009
@@ -21,7 +21,7 @@
#ifdef WIN32
#include <window/MCruxWin32Window.h>
#else
-#include <window/MCruxGTKWindow.h>
+#include <window/MCruxQTWindow.h>
#endif

MCruxWindowManager::MCruxWindowManager(const
list<MCruxWindowConfiguration*> & _windowConfigurations
@@ -45,7 +45,7 @@
#ifdef WIN32
newWindow = new MCruxWin32Window(mainWindowConfig, pluginManager, this);
#else
- newWindow = new MCruxGTKWindow(mainWindowConfig);
+ newWindow = new MCruxQTWindow(mainWindowConfig);
#endif

newWindow->ShowWindow();
=======================================
--- /trunk/src/lib/window/Makefile.am Sun Nov 1 05:42:59 2009
+++ /trunk/src/lib/window/Makefile.am Thu Nov 5 17:39:05 2009
@@ -6,13 +6,13 @@

noinst_HEADERS = \
MCruxWindowConfiguration.h \
- MCruxGTKWindow.h \
+ MCruxQTWindow.h \
MCruxWindowManager.h

lib_LTLIBRARIES = libmcrux_window.la

libmcrux_window_la_SOURCES = \
MCruxWindowConfiguration.cpp \
- MCruxGTKWindow.cpp \
+ MCruxQTWindow.cpp \
MCruxWindowManager.cpp

Reply all
Reply to author
Forward
0 new messages