summaryrefslogtreecommitdiff
path: root/mcompositor
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-09-15 00:34:37 +0300
committerAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-09-15 00:34:37 +0300
commit0d8eabb85959b3d3aa6104c83afc8a3c890ed6ef (patch)
tree1fe1c81a5f86dbc877a4ee5e5cda5f4f7231626a /mcompositor
parent0d260c0f4be2f3308398218ee9cb2a8c085b3b8e (diff)
Changes: Initial commit of a modularized compositing framework to support extensions
to modify core window management functionality. Added a new API as well for writing custom shader-based effects and transitions. Additional documentation for API coming later. RevBy: TrustMe
Diffstat (limited to 'mcompositor')
-rw-r--r--mcompositor/main.cpp87
-rw-r--r--mcompositor/mcompositor.pro16
2 files changed, 103 insertions, 0 deletions
diff --git a/mcompositor/main.cpp b/mcompositor/main.cpp
new file mode 100644
index 0000000..a2772b7
--- /dev/null
+++ b/mcompositor/main.cpp
@@ -0,0 +1,87 @@
+/***************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of mcompositor.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation
+** and appearing in the file LICENSE.LGPL included in the packaging
+** of this file.
+**
+****************************************************************************/
+
+#include <QtGui>
+#include <QGLWidget>
+#include "mcompositescene.h"
+#include "mcompositemanager.h"
+
+int main(int argc, char *argv[])
+{
+ // We don't need meego graphics system
+ setenv("QT_GRAPHICSSYSTEM", "raster", 1);
+
+ // Don't load any Qt plugins
+ QCoreApplication::setLibraryPaths(QStringList());
+ MCompositeManager app(argc, argv);
+
+ QGraphicsScene *scene = app.scene();
+ QGraphicsView view(scene);
+
+ view.setProperty("NoMStyle", true);
+ view.setUpdatesEnabled(false);
+ view.setAutoFillBackground(false);
+ view.setBackgroundBrush(Qt::NoBrush);
+ view.setForegroundBrush(Qt::NoBrush);
+ view.setFrameShadow(QFrame::Plain);
+
+ view.setWindowFlags(Qt::X11BypassWindowManagerHint);
+ view.setAttribute(Qt::WA_NoSystemBackground);
+#if QT_VERSION >= 0x040600
+ view.move(-2, -2);
+ view.setViewportUpdateMode(QGraphicsView::NoViewportUpdate);
+ view.setOptimizationFlags(QGraphicsView::IndirectPainting);
+#endif
+ app.setSurfaceWindow(view.winId());
+
+ view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ view.setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+ view.setMinimumSize(QApplication::desktop()->width() + 2,
+ QApplication::desktop()->height() + 2);
+ view.setMaximumSize(QApplication::desktop()->width() + 2,
+ QApplication::desktop()->height() + 2);
+
+ QGLFormat fmt;
+ fmt.setSamples(0);
+ fmt.setSampleBuffers(false);
+
+ QGLWidget *w = new QGLWidget(fmt);
+ w->setAttribute(Qt::WA_PaintOutsidePaintEvent);
+ QPalette p = w->palette();
+ p.setColor(QPalette::Background, QColor(Qt::black));
+ w->setPalette(p);
+ w->update();
+
+ w->setAutoFillBackground(false);
+ w->setMinimumSize(QApplication::desktop()->width(),
+ QApplication::desktop()->height());
+ w->setMaximumSize(QApplication::desktop()->width(),
+ QApplication::desktop()->height());
+ app.setGLWidget(w);
+ view.setViewport(w);
+ w->makeCurrent();
+ view.show();
+
+ app.prepareEvents();
+ app.redirectWindows();
+ app.loadPlugins();
+
+ return app.exec();
+}
diff --git a/mcompositor/mcompositor.pro b/mcompositor/mcompositor.pro
new file mode 100644
index 0000000..5dcfade
--- /dev/null
+++ b/mcompositor/mcompositor.pro
@@ -0,0 +1,16 @@
+include(../meegotouch_config.pri)
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += ../src
+
+LIBS += ../src/libmcompositor.so ../decorators/libdecorator/libdecorator.so
+
+target.path += $$M_INSTALL_BIN
+INSTALLS += target
+
+# Input
+SOURCES += main.cpp
+
+QT = gui opengl