View File decorator_removal.patch for package meego-ux-compositor (Project home:jieyang:branches:MeeGo:1.2.0:oss:Update:Testing)
From 09fdf5793e6da9a5325b51fce3a6e8dc723e2f24 Mon Sep 17 00:00:00 2001
From: Mika Yrjola <mika.yrjola@movial.com>
Date: Thu, 17 Mar 2011 13:30:54 +0200
Subject: [PATCH] Decorator removal for 0.8.5-1
---
decorators/decorators.pro | 16 -
decorators/libdecorator/interface.xml | 19 -
decorators/libdecorator/libdecorator.pro | 27 -
decorators/libdecorator/mabstractappinterface.cpp | 118 ----
decorators/libdecorator/mabstractappinterface.h | 97 ---
decorators/libdecorator/mabstractdecorator.cpp | 155 -----
decorators/libdecorator/mabstractdecorator.h | 160 -----
decorators/libdecorator/mdecorator_dbus.xml | 20 -
decorators/libdecorator/mrmiclient.cpp | 279 ---------
decorators/libdecorator/mrmiclient.h | 124 ----
decorators/libdecorator/mrmiclient_p.h | 74 ---
decorators/libdecorator/mrmiserver.cpp | 323 ----------
decorators/libdecorator/mrmiserver.h | 86 ---
decorators/libdecorator/mrmiserver_p.h | 73 ---
decorators/mdecorator/main.cpp | 49 --
decorators/mdecorator/mdecorator.pro | 17 -
decorators/mdecorator/mdecoratorwindow.cpp | 671 ---------------------
decorators/mdecorator/mdecoratorwindow.h | 107 ----
mcompositor.pro | 7 +-
mcompositor/mcompositor.pro | 2 +-
src/mcompatoms_p.h | 3 -
src/mcompositemanager.cpp | 597 ++----------------
src/mcompositemanager.h | 17 +-
src/mcompositemanager_p.h | 12 +-
src/mcompositescene.cpp | 15 +-
src/mcompositewindow.cpp | 19 +-
src/mcompositewindow.h | 10 -
src/mdecoratorframe.cpp | 190 ------
src/mdecoratorframe.h | 118 ----
src/mwindowpropertycache.cpp | 22 -
src/mwindowpropertycache.h | 2 -
src/src.pro | 8 +-
tests/appinterface/appinterface.pro | 14 -
tests/appinterface/main.cpp | 159 -----
tests/tests.pro | 3 +-
translations/recovery.ts | 27 -
translations/translations.pro | 4 +-
38 files changed, 81 insertions(+), 3564 deletions(-)
delete mode 100644 decorators/decorators.pro
delete mode 100644 decorators/libdecorator/interface.xml
delete mode 100644 decorators/libdecorator/libdecorator.pro
delete mode 100644 decorators/libdecorator/mabstractappinterface.cpp
delete mode 100644 decorators/libdecorator/mabstractappinterface.h
delete mode 100644 decorators/libdecorator/mabstractdecorator.cpp
delete mode 100644 decorators/libdecorator/mabstractdecorator.h
delete mode 100644 decorators/libdecorator/mdecorator_dbus.xml
delete mode 100644 decorators/libdecorator/mrmiclient.cpp
delete mode 100644 decorators/libdecorator/mrmiclient.h
delete mode 100644 decorators/libdecorator/mrmiclient_p.h
delete mode 100644 decorators/libdecorator/mrmiserver.cpp
delete mode 100644 decorators/libdecorator/mrmiserver.h
delete mode 100644 decorators/libdecorator/mrmiserver_p.h
delete mode 100644 decorators/mdecorator/main.cpp
delete mode 100644 decorators/mdecorator/mdecorator.pro
delete mode 100644 decorators/mdecorator/mdecoratorwindow.cpp
delete mode 100644 decorators/mdecorator/mdecoratorwindow.h
delete mode 100644 src/mdecoratorframe.cpp
delete mode 100644 src/mdecoratorframe.h
delete mode 100644 tests/appinterface/appinterface.pro
delete mode 100644 tests/appinterface/main.cpp
delete mode 100644 translations/recovery.ts
--- a/decorators/decorators.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-TEMPLATE = subdirs
-#temporary disable
-CONFIG+=ordered
-SUBDIRS += \
- sub_lib \
- sub_decorator \
-
-sub_lib.subdir=libdecorator
-
-sub_decorator.depends=sub_lib
-sub_decorator.subdir=mdecorator
-
-
-check.target = check
-check.CONFIG = recursive
-QMAKE_EXTRA_TARGETS += check
--- a/decorators/libdecorator/interface.xml
+++ /dev/null
@@ -1,19 +0,0 @@
- <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
- <node>
- <interface name="com.nokia.MDecorator">
- <method name="setActions">
- <arg type="a(ssbbuay)" name="actions" direction="in" />
- <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="IPCActionList"/>
- <arg type="u" name="window" direction="in" />
- </method>
- <signal name="triggered">
- <arg type="s" name="uuid" direction="out" />
- <arg type="b" name="checked" direction="out" />
- </signal>
- <signal name="toggled">
- <arg type="s" name="uuid" direction="out" />
- <arg type="b" name="checked" direction="out" />
- </signal>
- </interface>
- </node>
--- a/decorators/libdecorator/libdecorator.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-include(../../meegotouch_config.pri)
-TEMPLATE = lib
-DEPENDPATH += .
-INCLUDEPATH += .
-CONFIG += dll release
-QT += opengl network dbus
-TARGET = decorator
-
-DBUS_ADAPTORS = mdecorator_dbus.xml
-DBUS_INTERFACES = mdecorator_dbus.xml
-QMAKE_QDBUSXML2CPP = $$[QT_INSTALL_BINS]/qdbusxml2cpp -i mabstractappinterface.h \$(if $(filter mdecorator_dbus_interface.%,\$@),-c MDecoratorInterface)
-
-publicHeaders.files = mabstractdecorator.h mrmiclient.h mrmiserver.h \
- mabstractappinterface.h mdecorator_dbus_interface.h
-HEADERS += $${publicHeaders.files} mrmiclient_p.h mrmiserver_p.h
-SOURCES += mabstractdecorator.cpp mrmiclient.cpp mrmiserver.cpp \
- mabstractappinterface.cpp
-PRE_TARGETDEPS += mdecorator_dbus_interface.h
-
-publicHeaders.path = $$M_INSTALL_HEADERS/libdecorator
-publicHeaders.CONFIG += no_check_exist
-INSTALLS += publicHeaders
-target.path = /usr/lib
-INSTALLS += target
-QMAKE_EXTRA_TARGETS += check
-check.depends = $$TARGET
-check.commands = $$system(true)
--- a/decorators/libdecorator/mabstractappinterface.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 <QtDebug>
-
-#include "mabstractappinterface.h"
-#include "mdecorator_dbus_adaptor.h"
-#include "mabstractdecorator.h"
-#include <mrmiserver.h>
-#include <mrmiclient.h>
-#include <QX11Info>
-#include <QRect>
-#include <QRegion>
-#include <QDesktopWidget>
-#include <QApplication>
-#include <QMenu>
-#include <QPixmap>
-
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MDecoratorIPCAction &action)
-{
- argument.beginStructure();
- argument << action.m_key.toString();
- argument << action.m_text;
- argument << action.m_checkable;
- argument << action.m_checked;
- argument << (uint)action.m_type;
-
- if (action.m_icon.isNull()) {
- argument << QByteArray();
- } else {
- if (action.m_icon.pixmap(48,48).isNull())
- qCritical() << "MDecorator: Pixmap creation failed";
-
- QImage image = action.m_icon.pixmap(48,48).toImage();
- if (image.isNull())
- qCritical() << "MDecorator: Icon Conversion failed";
- QByteArray data;
- QBuffer buffer(&data);
- buffer.open(QIODevice::WriteOnly);
- if (!image.save(&buffer,"PNG"))
- qCritical() << "MDecorator: Write to Buffer failed";
- argument << data;
- }
-
- argument.endStructure();
- return argument;
-}
-const QDBusArgument &operator>>(const QDBusArgument &argument, MDecoratorIPCAction &action)
-{
- argument.beginStructure();
- int type;
- QString uuid;
- argument >> uuid;
- action.m_key = QUuid(uuid);
- argument >> action.m_text;
- argument >> action.m_checkable;
- argument >> action.m_checked;
- argument >> type;
- QByteArray data;
- argument >> data;
- if(!data.isNull()){
- QImage image = QImage::fromData(data,"PNG");
- if (image.isNull())
- qCritical() << "MDecorator: Icon loading failed";
- action.m_icon = QIcon(QPixmap::fromImage(image));
- }
- action.m_type = (MDecoratorIPCAction::ActionType)type;
- argument.endStructure();
- return argument;
-}
-
-class MAbstractAppInterfacePrivate
-{
-public:
-
- MDecoratorAdaptor* adaptor;
- MAbstractAppInterface* q_ptr;
-};
-
-MAbstractAppInterface::MAbstractAppInterface(QObject *parent)
- : QObject(parent),
- d_ptr(new MAbstractAppInterfacePrivate())
-{
- qDBusRegisterMetaType<MDecoratorIPCAction>();
- qDBusRegisterMetaType<MDecoratorIPCActionList>();
-
- d_ptr->adaptor = new MDecoratorAdaptor(this);
-
- QDBusConnection::sessionBus().registerService("com.nokia.MDecorator");
- QDBusConnection::sessionBus().registerObject("/MDecorator", this);
-}
-
-MAbstractAppInterface::~MAbstractAppInterface()
-{
-}
-
-void MAbstractAppInterface::setActions(MDecoratorIPCActionList menu ,uint window)
-{
- actionsChanged(menu, (WId)window);
-}
-
--- a/decorators/libdecorator/mabstractappinterface.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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.
-**
-****************************************************************************/
-
-#ifndef MABSTRACTAPPINTERFACE_H
-#define MABSTRACTAPPINTERFACE_H
-
-#include <QObject>
-#include <QAction>
-#include <QUuid>
-#include <QDBusArgument>
-
-class MAbstractAppInterfacePrivate;
-class MRmiClient;
-class QRect;
-class QMenu;
-
-/*! The MDecoratorIPCAction class is used to send a QAction over IPC*/
-class MDecoratorIPCAction
-{
-public:
- /*! defines the location of the action*/
- enum ActionType{
- MenuAction,
- ToolBarAction
- };
-
- MDecoratorIPCAction()
- : m_checkable(false)
- , m_checked(false)
- , m_type(MenuAction)
- {
- }
-
- MDecoratorIPCAction(const QAction& act, MDecoratorIPCAction::ActionType type)
- : m_text(act.text())
- , m_checkable(act.isCheckable())
- , m_checked(act.isChecked())
- , m_type(type)
- , m_icon(act.icon())
- {
- if (m_text.contains('&'))
- m_text.remove('&');
- m_key = QUuid::createUuid();
- }
-
- /*! the uniqueid() of the action*/
- QUuid id() const {return m_key; }
-
- QString text() const {return m_text; }
-
- bool isCheckable() const {return m_checkable; }
-
- bool isChecked() const {return m_checked; }
-
- MDecoratorIPCAction::ActionType type() const {return m_type; }
-
- QIcon icon() const {return m_icon; }
-
- //friend to access the member variables directly because we don't have setter
- friend QDBusArgument &operator<<(QDBusArgument &argument, const MDecoratorIPCAction &action);
- friend const QDBusArgument &operator>>(const QDBusArgument &argument, MDecoratorIPCAction &action);
-
-private:
-
- QUuid m_key;
- QString m_text;
- bool m_checkable;
- bool m_checked;
- ActionType m_type;
- QIcon m_icon;
-};
-
-typedef QList<MDecoratorIPCAction> MDecoratorIPCActionList;
-
-QDBusArgument &operator<<(QDBusArgument &argument, const MDecoratorIPCAction &action);
-const QDBusArgument &operator>>(const QDBusArgument &argument, MDecoratorIPCAction &action);
-
-Q_DECLARE_METATYPE(MDecoratorIPCAction);
-Q_DECLARE_METATYPE(MDecoratorIPCActionList);
-
-#endif // MABSTRACTAPPINTERFACE_H
--- a/decorators/libdecorator/mabstractdecorator.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 <QtDebug>
-
-#include "mabstractdecorator.h"
-#include <mrmiserver.h>
-#include <mrmiclient.h>
-#include <QX11Info>
-#include <QRect>
-#include <QRegion>
-#include <QDesktopWidget>
-#include <QApplication>
-
-#include <X11/Xutil.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xmd.h>
-
-class MAbstractDecoratorPrivate
-{
-public:
-
- Qt::HANDLE client;
- MRmiClient* remote_compositor;
- QRect clientGeometry;
- MAbstractDecorator* q_ptr;
-};
-
-MAbstractDecorator::MAbstractDecorator(QObject *parent)
- : QObject(parent),
- d_ptr(new MAbstractDecoratorPrivate())
-{
- Q_D(MAbstractDecorator);
-
- MRmiServer *s = new MRmiServer(".mabstractdecorator", this);
- s->exportObject(this);
- d->remote_compositor = new MRmiClient(".mcompositor", this);
-}
-
-MAbstractDecorator::~MAbstractDecorator()
-{
-}
-
-Qt::HANDLE MAbstractDecorator::managedWinId()
-{
- Q_D(MAbstractDecorator);
-
- return d->client;
-}
-
-void MAbstractDecorator::minimize()
-{
- /* TODO */
- XEvent e;
- memset(&e, 0, sizeof(e));
-
- e.xclient.type = ClientMessage;
- e.xclient.message_type = XInternAtom(QX11Info::display(), "WM_CHANGE_STATE",
- False);
- e.xclient.display = QX11Info::display();
- e.xclient.window = managedWinId();
- e.xclient.format = 32;
- e.xclient.data.l[0] = IconicState;
- e.xclient.data.l[1] = 0;
- e.xclient.data.l[2] = 0;
- e.xclient.data.l[3] = 0;
- e.xclient.data.l[4] = 0;
- XSendEvent(QX11Info::display(), QX11Info::appRootWindow(),
- False, (SubstructureNotifyMask | SubstructureRedirectMask), &e);
-
- XSync(QX11Info::display(), FALSE);
-}
-
-void MAbstractDecorator::close()
-{
- XEvent e;
- memset(&e, 0, sizeof(e));
-
- e.xclient.type = ClientMessage;
- e.xclient.window = managedWinId();
- e.xclient.message_type = XInternAtom(QX11Info::display(),
- "_NET_CLOSE_WINDOW", False);
- e.xclient.format = 32;
- e.xclient.data.l[0] = CurrentTime;
- e.xclient.data.l[1] = QX11Info::appRootWindow();
- XSendEvent(QX11Info::display(), QX11Info::appRootWindow(),
- False, SubstructureRedirectMask | SubstructureNotifyMask, &e);
-
- XSync(QX11Info::display(), FALSE);
-}
-
-void MAbstractDecorator::RemoteSetManagedWinId(qulonglong window)
-{
- Q_D(MAbstractDecorator);
-
- d->client = window;
- manageEvent(window);
-}
-
-void MAbstractDecorator::RemoteActivateWindow()
-{
- activateEvent();
-}
-
-void MAbstractDecorator::RemoteSetAutoRotation(bool mode)
-{
- setAutoRotation(mode);
-}
-
-void MAbstractDecorator::RemoteSetClientGeometry(const QRect& r)
-{
- Q_D(MAbstractDecorator);
- d->clientGeometry = r;
-}
-
-void MAbstractDecorator::setAvailableGeometry(const QRect& rect)
-{
- Q_D(MAbstractDecorator);
-
- d->remote_compositor->invoke("MCompositeManager", "decoratorRectChanged", rect);
-}
-
-void MAbstractDecorator::queryDialogAnswer(unsigned int w, bool a)
-{
- Q_D(MAbstractDecorator);
-
- d->remote_compositor->invoke("MCompositeManager", "queryDialogAnswer", w, a);
-}
-
-void MAbstractDecorator::RemoteSetOnlyStatusbar(bool mode)
-{
- setOnlyStatusbar(mode);
-}
-
-void MAbstractDecorator::RemoteShowQueryDialog(bool visible)
-{
- showQueryDialog(visible);
-}
--- a/decorators/libdecorator/mabstractdecorator.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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.
-**
-****************************************************************************/
-
-#ifndef MABSTRACTDECORATOR_H
-#define MABSTRACTDECORATOR_H
-
-#include <QObject>
-#include "mabstractappinterface.h"
-
-class MAbstractDecoratorPrivate;
-class MRmiClient;
-class QRect;
-
-/*!
- * MAbstractDecorator is the base class for window decorators
- */
-class MAbstractDecorator: public QObject
-{
- Q_OBJECT
-public:
- /*!
- * Initializes MAbstractDecorator and the connections to MCompositor
- */
- MAbstractDecorator(QObject *parent = 0);
- virtual ~MAbstractDecorator() = 0;
-
- /*!
- * Returns the id of the window decorated by this decorator
- */
- Qt::HANDLE managedWinId();
-
- /*!
- * Informs the compositor of the available client geometry when client
- * is managed by the decorator.
- *
- * \param rect is the geometry of the decorator area.
- */
- void setAvailableGeometry(const QRect& rect);
-
- /*!
- * Informs the compositor what was the answer to the query dialog.
- *
- * \param window managed window that the answer concerns.
- * \param yes_answer true if the answer was 'yes'.
- */
- void queryDialogAnswer(unsigned int window, bool yes_answer);
-
-public slots:
-
- /*!
- * Minimizes the managed window
- */
- void minimize();
-
- /*!
- * Closes the managed window
- */
- void close();
-
- /*!
- * Interface to MRMI sockets
- */
- void RemoteSetManagedWinId(qulonglong window);
- void RemoteActivateWindow();
- void RemoteSetAutoRotation(bool mode);
- void RemoteSetClientGeometry(const QRect& rect);
- void RemoteSetOnlyStatusbar(bool mode);
- void RemoteShowQueryDialog(bool visible);
-
-protected:
-
- /*!
- * Pure virtual function that gets called when the user activates the
- * managed window by tapping on its client area.
- * Re-implement to obtain activate events from the managed window
- */
- virtual void activateEvent() = 0;
-
- /*!
- * Pure virtual function that gets called this decorator manages a window
- */
- virtual void manageEvent(Qt::HANDLE window) = 0;
-
- /*!
- * Pure virtual function to set automatic rotation mode.
- */
- virtual void setAutoRotation(bool mode) = 0;
-
- /*!
- * Pure virtual function to set "only statusbar" mode.
- */
- virtual void setOnlyStatusbar(bool mode) = 0;
-
- /*!
- * Pure virtual function to show the "not responding" query dialog.
- */
- virtual void showQueryDialog(bool visible) = 0;
-
-private:
-
- Q_DECLARE_PRIVATE(MAbstractDecorator)
-
- MAbstractDecoratorPrivate * const d_ptr;
-};
-
-/*!
- * MAbstractAppInterface is the base class for Application Interface
-
- It is used to communicate to the current decorated Application.
- */
-class MAbstractAppInterface: public QObject
-{
- Q_OBJECT
-public:
- /*!
- * Initializes MAbstractAppInterface and listens for Messages from the Application
- */
- MAbstractAppInterface(QObject *parent = 0);
- virtual ~MAbstractAppInterface() = 0;
-
-signals:
- /*! Sends the triggered signal for the given Action to the current decorated Application*/
- void triggered(QString id, bool val);
- /*! Sends the toggled signal for the given Action to the current decorated Application*/
- void toggled(QString id, bool val);
-
-public slots:
-
- /*! set the List of Actions in the Menu/ToolBar of the decorator. The window is used
- to check for the current decorated window */
- void setActions(MDecoratorIPCActionList ,uint window);
-
-protected:
-
- virtual void actionsChanged(QList<MDecoratorIPCAction>, WId window) = 0;
-
-private:
-
- Q_DECLARE_PRIVATE(MAbstractAppInterface)
-
- MAbstractAppInterfacePrivate * const d_ptr;
-};
-
-#endif //MABSTRACTDECORATOR_H
--- a/decorators/libdecorator/mdecorator_dbus.xml
+++ /dev/null
@@ -1,20 +0,0 @@
- <!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
- "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
- <node>
- <interface name="com.nokia.MDecorator">
- <method name="setActions">
- <arg type="a(ssbbuay)" name="actions" direction="in" />
- <annotation
- name="com.trolltech.QtDBus.QtTypeName.In0" value="MDecoratorIPCActionList"/>
- <arg type="u" name="window" direction="in" />
- </method>
- <signal name="triggered">
- <arg type="s" name="uuid" direction="out" />
- <arg type="b" name="checked" direction="out" />
- </signal>
- <signal name="toggled">
- <arg type="s" name="uuid" direction="out" />
- <arg type="b" name="checked" direction="out" />
- </signal>
- </interface>
- </node>
--- a/decorators/libdecorator/mrmiclient.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 "mrmiclient_p.h"
-#include "mrmiclient.h"
-#include <QDataStream>
-#include <QByteArray>
-
-MRmiClientPrivate:: MRmiClientPrivate(const QString& key)
- : q_ptr(0)
-{
- _key = "/tmp/" + key;
-}
-
-MRmiClientPrivate::~MRmiClientPrivate()
-{
-}
-
-void MRmiClientPrivate::initConnection()
-{
- //unused
-}
-
-void MRmiClientPrivate::finalizeConnection()
-{
- // unused
-}
-
-QString MRmiClientPrivate::key() const
-{
- return _key;
-}
-
-MRmiClientPrivateSocket::MRmiClientPrivateSocket(const QString& key, MRmiClient *q)
- : MRmiClientPrivate(key),
- _stream(0),
- return_sz(0)
-{
- q_ptr = q;
- QObject::connect(&_socket, SIGNAL(readyRead()), q_ptr, SLOT(_q_readyRead()));
-}
-
-
-void MRmiClientPrivateSocket::initConnection()
-{
- _buf.clear();
- _stream = new QDataStream(&_buf, QIODevice::WriteOnly);
- _stream->setVersion(QDataStream::Qt_4_0);
-
- connectToServer();
- if (!_socket.waitForConnected())
- qDebug() << "MRmiClientPrivateSocket" << _socket.errorString() << key();
-}
-
-void MRmiClientPrivateSocket::finalizeConnection()
-{
- uint sz = _buf.size();
- _stream->device()->seek(0);
- *_stream << (quint16)(sz - sizeof(quint16));
-
- if (_socket.state() == QLocalSocket::ConnectedState) {
- writeData(_buf);
- }
-
- _socket.close();
- delete _stream;
-}
-
-QDataStream& MRmiClientPrivateSocket::stream()
-{
- return *_stream;
-}
-
-void MRmiClientPrivateSocket::writeData(const QByteArray& buffer)
-{
- _socket.write(buffer);
- _socket.waitForBytesWritten();
- // _socket.disconnect();
-}
-
-void MRmiClientPrivateSocket::connectToServer()
-{
- if (_socket.state() == QLocalSocket::UnconnectedState)
- _socket.connectToServer(key());
-}
-
-void MRmiClientPrivateSocket::_q_readyRead()
-{
- Q_Q(MRmiClient);
- QDataStream stream(&_socket);
- stream.setVersion(QDataStream::Qt_4_0);
-
- if (return_sz == 0) {
- if (_socket.bytesAvailable() < (int)sizeof(quint16))
- return;
- stream >> return_sz;
- }
-
- if (_socket.bytesAvailable() < return_sz)
- return;
-
- QVariant v;
- stream >> v;
- emit q->returnValue(v);
-}
-
-MRmiClient::MRmiClient(const QString& key, QObject* p)
- : QObject(p),
- d_ptr(new MRmiClientPrivateSocket(key, this))
-{
-}
-MRmiClient::~MRmiClient()
-{
- delete d_ptr;
-}
-
-void MRmiClient::initConnection()
-{
- Q_D(MRmiClient);
- d->initConnection();
-}
-
-void MRmiClient::finalizeConnection()
-{
- Q_D(MRmiClient);
- d->finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method)
-{
- Q_D(MRmiClient);
- initConnection();
-
- /* packet is composed of |block size|argument length|arguments...| */
- d->stream() << (quint16)0 << (quint16)0 << objectName << method;
-
- finalizeConnection();
-}
-
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)1 << objectName << method << arg0;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)2 << objectName << method << arg0
- << arg1;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)3 << objectName << method << arg0
- << arg1 << arg2;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)4 << objectName << method << arg0
- << arg1 << arg2 << arg3;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)5 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)6 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4 << arg5;
- finalizeConnection();
-
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)7 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4 << arg5 << arg6;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)8 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << arg7;
- finalizeConnection();
-
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7,
- const QVariant& arg8)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)9 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << arg7 << arg8;
- finalizeConnection();
-}
-
-void MRmiClient::invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7,
- const QVariant& arg8, const QVariant& arg9)
-{
- Q_D(MRmiClient);
- initConnection();
- d->stream() << (quint16)0 << (quint16)10 << objectName << method << arg0
- << arg1 << arg2 << arg3 << arg4 << arg5 << arg6 << arg7 << arg8
- << arg9;
- finalizeConnection();
-}
-
-#include "moc_mrmiclient.cpp"
-
--- a/decorators/libdecorator/mrmiclient.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/***************************************************************************
-**
-** 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.
-**
-****************************************************************************/
-// -*- C++ -*-
-#ifndef MRMICLIENT_H
-#define MRMICLIENT_H
-
-#include <QVariant>
-#include <QObject>
-
-class MRmiClientPrivate;
-class MRmiClientPrivateSocket;
-
-/*!
- * \class MRmiClient
- *
- * \brief The MRmiClient allows member functions of QObjects exported by
- * MRmiServer from another process to be invoked remotely.
- */
-class MRmiClient: public QObject
-{
- Q_OBJECT
-
-public:
-
- /*!
- * Creates a MRmiClient
- *
- * \param key the key used to identify the remote MRmiServer
- * \param parent the parent QObject
- */
- explicit MRmiClient(const QString& key, QObject* parent = 0);
-
- /*!
- * Disconnects all connections and destroys this object
- */
- virtual ~MRmiClient();
-
- /*!
- * Invoked the remote function
- *
- * \param objectName the name of the remote object. Currently unused
- * \param method literal string of the method name of the remote object
- * \param argN QVariant representation of the arguments of the remote method
- */
- void invoke(const char* objectName, const char* method);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7,
- const QVariant& arg8);
- void invoke(const char* objectName, const char* method,
- const QVariant& arg0, const QVariant& arg1,
- const QVariant& arg2, const QVariant& arg3,
- const QVariant& arg4, const QVariant& arg5,
- const QVariant& arg6, const QVariant& arg7,
- const QVariant& arg8, const QVariant& arg9);
-
-Q_SIGNALS:
- /*!
- * Signal emitted when a remote function has a return value expected
- *
- * \param arg QVariant representation of the data returned.
- */
- void returnValue(const QVariant& arg);
-
-private:
- Q_DISABLE_COPY(MRmiClient)
- Q_DECLARE_PRIVATE(MRmiClient)
-
- void initConnection();
- void finalizeConnection();
-
- MRmiClientPrivate * const d_ptr;
- friend class MRmiClientPrivateSocket;
-
- Q_PRIVATE_SLOT(d_func(), void _q_readyRead())
-};
-
-#endif // QRMICLIENT_H
--- a/decorators/libdecorator/mrmiclient_p.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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.
-**
-****************************************************************************/
-#ifndef MRMICLIENT_P_H
-#define MRMICLIENT_P_H
-
-#include <QLocalSocket>
-#include <QByteArray>
-
-class QDataStream;
-class MRmiClient;
-
-class MRmiClientPrivate
-{
- Q_DECLARE_PUBLIC(MRmiClient)
-public:
- MRmiClientPrivate(const QString& key);
- virtual ~MRmiClientPrivate();
- virtual void writeData(const QByteArray&) = 0;
- virtual void connectToServer() = 0;
- virtual QDataStream& stream() = 0;
-
- virtual void initConnection();
- virtual void finalizeConnection();
-
- QString key() const;
-
- void returnValue(const QVariant& v);
-
- MRmiClient * q_ptr;
-
- virtual void _q_readyRead() = 0;
-private:
- QString _key;
-};
-
-class MRmiClientPrivateSocket: public MRmiClientPrivate
-{
- Q_DECLARE_PUBLIC(MRmiClient)
-public:
-
- MRmiClientPrivateSocket(const QString& key, MRmiClient *q);
-
- void writeData(const QByteArray&);
- void connectToServer();
- void initConnection();
- void finalizeConnection();
- QDataStream& stream();
-
- virtual void _q_readyRead();
-
-private:
- QLocalSocket _socket;
- QByteArray _buf;
- QDataStream* _stream;
- quint16 return_sz;
-};
-
-#endif //MRMICLIENT_P_H
--- a/decorators/libdecorator/mrmiserver.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 "mrmiserver.h"
-#include "mrmiserver_p.h"
-
-#include <QLocalSocket>
-#include <QDataStream>
-#include <QMetaObject>
-#include <QGenericArgument>
-#include <QFile>
-#include <QTextStream>
-
-QGenericArgument unmarshall(const char*name, const void* data)
-{
- return QGenericArgument(name, data);
-}
-
-MRmiServerPrivate::MRmiServerPrivate(const QString& key)
- : q_ptr(0), _obj(0)
-{
- _key = "/tmp/" + key;
-}
-
-MRmiServerPrivate::~MRmiServerPrivate()
-{
-}
-
-void MRmiServerPrivate::exportObject(QObject* p)
-{
- _obj = p;
-}
-
-// TODO object selection from multiple sources
-QObject* MRmiServerPrivate::currentObject()
-{
- return _obj;
-}
-
-QString MRmiServerPrivate::key() const
-{
- return _key;
-}
-
-MRmiServerPrivateSocket::MRmiServerPrivateSocket(const QString& key)
- : MRmiServerPrivate(key), method_size(0)
-{
-}
-
-MRmiServerPrivateSocket::~MRmiServerPrivateSocket()
-{
-}
-
-void MRmiServerPrivateSocket::exportObject(QObject* p)
-{
- Q_Q(MRmiServer);
- MRmiServerPrivate::exportObject(p);
-
- q->connect(&_serv, SIGNAL(newConnection()), q, SLOT(_q_incoming()));
-
- if (QFile::exists(key()))
- QFile::remove(key());
-
- if (!_serv.listen(key()))
- qDebug() << "MRmiServerPrivateSocket" << "can't listen to local socket"
- << key();
-}
-
-void MRmiServerPrivateSocket::_q_incoming()
-{
- Q_Q(MRmiServer);
- QLocalSocket* s = _serv.nextPendingConnection();
- q->connect(s, SIGNAL(disconnected()), s, SLOT(deleteLater()));
- if (!s)
- return;
- q->connect(s, SIGNAL(readyRead()), this, SLOT(_q_readData()));
-}
-
-void MRmiServerPrivateSocket::_q_readData()
-{
- QLocalSocket* socket = (QLocalSocket*) sender();
- uint sz = socket->bytesAvailable();
-
- QDataStream stream(socket);
- stream.setVersion(QDataStream::Qt_4_0);
-
- if (method_size == 0) {
- if (sz < (int)sizeof(quint16))
- return;
- stream >> method_size;
- }
-
- if (sz < method_size)
- return;
-
- invoke(stream);
-}
-
-void MRmiServerPrivateSocket::invoke(QDataStream& stream)
-{
- char* className = 0;
- char* methodName = 0;
- quint16 arglength = 0;
-
- QVariant arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9;
-
- stream >> arglength >> className >> methodName;
- switch (arglength) {
- case 0:
- QMetaObject::invokeMethod(currentObject(),
- methodName);
- break;
- case 1:
- stream >> arg0;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()));
-
- break;
- case 2:
- stream >> arg0 >> arg1;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()));
- break;
- case 3:
- stream >> arg0 >> arg1 >> arg2;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()));
- break;
- case 4:
- stream >> arg0 >> arg1 >> arg2 >> arg3;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()));
- break;
- case 5:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()));
- break;
- case 6:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4 >> arg5;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()),
- unmarshall(arg5.typeName(),
- arg5.data()));
- break;
- case 7:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4 >> arg5 >> arg6;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()),
- unmarshall(arg5.typeName(),
- arg5.data()),
- unmarshall(arg6.typeName(),
- arg6.data()));
- break;
- case 8:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4 >> arg5 >> arg6 >> arg7;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()),
- unmarshall(arg5.typeName(),
- arg5.data()),
- unmarshall(arg6.typeName(),
- arg6.data()),
- unmarshall(arg7.typeName(),
- arg7.data()));
- break;
- case 9:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4 >> arg5 >> arg6 >> arg7
- >> arg8;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()),
- unmarshall(arg5.typeName(),
- arg5.data()),
- unmarshall(arg6.typeName(),
- arg6.data()),
- unmarshall(arg7.typeName(),
- arg7.data()),
- unmarshall(arg8.typeName(),
- arg8.data()));
- break;
- case 10:
- stream >> arg0 >> arg1 >> arg2 >> arg3 >> arg4 >> arg5 >> arg6 >> arg7
- >> arg8 >> arg9;
- QMetaObject::invokeMethod(currentObject(),
- methodName,
- unmarshall(arg0.typeName(),
- arg0.data()),
- unmarshall(arg1.typeName(),
- arg1.data()),
- unmarshall(arg2.typeName(),
- arg2.data()),
- unmarshall(arg3.typeName(),
- arg3.data()),
- unmarshall(arg4.typeName(),
- arg4.data()),
- unmarshall(arg5.typeName(),
- arg5.data()),
- unmarshall(arg6.typeName(),
- arg6.data()),
- unmarshall(arg7.typeName(),
- arg7.data()),
- unmarshall(arg8.typeName(),
- arg8.data()),
- unmarshall(arg9.typeName(),
- arg9.data()));
- break;
- default:
- break;
-
- }
-
- delete[] className;
- delete[] methodName;
- method_size = 0;
-}
-
-
-MRmiServer::MRmiServer(const QString& key, QObject* p)
- : QObject(p),
- d_ptr(new MRmiServerPrivateSocket(key))
-{
- d_ptr->q_ptr = this;
-}
-
-
-MRmiServer::~MRmiServer()
-{
- delete d_ptr;
-}
-
-
-void MRmiServer::exportObject(QObject* obj)
-{
- Q_D(MRmiServer);
- d->exportObject(obj);
-}
-
-#include "moc_mrmiserver.cpp"
-
--- a/decorators/libdecorator/mrmiserver.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/***************************************************************************
-**
-** 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.
-**
-****************************************************************************/
-// -*- C++ -*-
-
-#ifndef MRMISERVER_H
-#define MRMISERVER_H
-
-#include <QObject>
-
-class MRmiServerPrivate;
-class MRmiServerPrivateSocket;
-
-/*!
- * \class MRmiServer
- * \brief The MRmiServer provides a way for member functions of QObject-based
- * classes to be directly invoked from another process without relying on an
- * external transport such as d-bus.
- *
- * To make a QObject-based class remotely callable from another process,
- * ensure that the object has Q_OBJECT macro and the member functions you want
- * to export are public slots themselves.
- *
- * The types of the arguments of those member functions need to be supported
- * by QVariant as well. Most Qt types are supported. This include from plain
- * old data types to complex GUI types such as QRect, QColor, QImages, and more.
- * Container types such as QList are even supported.
- *
- * If needed, custom complex classes can also be sent across the wire
- * provided the operator QVariant(), operator<<() and
- * operator>>() are overloaded, and the class is declared in Qt's metaobject
- * system using qRegisterMetaType(). Qt uses this class internally for
- * mashalling/unmarshalling types (see QMetaType for details).
- */
-class MRmiServer: public QObject
-{
- Q_OBJECT
-
-public:
- /*!
- * Creates a MRmiServer
- *
- * \param key a unique key that identifies this server
- * \param parent QObject.
- */
- explicit MRmiServer(const QString& key, QObject* parent = 0);
-
- /*!
- * Disconnects all connections and destroys this object
- */
- virtual ~MRmiServer();
-
- /*!
- * Export a QObject for remote invocation. Currently only one QObject per
- * MRmiServer is supported.
- *
- * \param object QObject to be exported.
- */
- void exportObject(QObject* object);
-
-private:
- Q_DISABLE_COPY(MRmiServer)
- Q_DECLARE_PRIVATE(MRmiServer)
- Q_PRIVATE_SLOT(d_func(), void _q_incoming())
- Q_PRIVATE_SLOT(d_func(), void _q_readData())
-
- MRmiServerPrivate * const d_ptr;
- friend class MRmiServerPrivateSocket;
-};
-
-#endif
--- a/decorators/libdecorator/mrmiserver_p.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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.
-**
-****************************************************************************/
-
-
-#ifndef MRMISERVER_P_H
-#define MRMISERVER_P_H
-
-#include <QVariant>
-#include <QLocalServer>
-#include <QObject>
-
-class QDataStream;
-class MRmiServer;
-
-class MRmiServerPrivate
-{
- Q_DECLARE_PUBLIC( MRmiServer )
-public:
-
- MRmiServerPrivate(const QString& key);
- virtual ~MRmiServerPrivate();
- virtual void exportObject(QObject* p);
- QObject* currentObject();
- QString key() const;
-
- virtual void _q_incoming() = 0;
- virtual void _q_readData() = 0;
-
- MRmiServer * q_ptr;
-private:
- QString _key;
- QObject* _obj;
-};
-
-class MRmiServerPrivateSocket: public QObject, public MRmiServerPrivate
-{
- Q_OBJECT
- Q_DECLARE_PUBLIC( MRmiServer )
-
-public:
- MRmiServerPrivateSocket(const QString& key);
- virtual ~MRmiServerPrivateSocket();
-
- virtual void exportObject(QObject* p);
-
-public slots:
- virtual void _q_incoming();
- virtual void _q_readData();
-
-private:
- void invoke(QDataStream&);
-
- QLocalServer _serv;
- quint16 method_size;
-};
-
-#endif //MRMISERVER_P_H
--- a/decorators/mdecorator/main.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 <QTextStream>
-#include <MApplication>
-#include "mdecoratorwindow.h"
-
-class MDecoratorApp : public MApplication
-{
-public:
- MDecoratorApp(int argc, char **argv) : MApplication(argc, argv)
- {
- window.show();
- }
-
- virtual bool x11EventFilter(XEvent *e)
- {
- bool ret = window.x11Event(e);
- if (!ret)
- ret = MApplication::x11EventFilter(e);
- return ret;
- }
-
-private:
- MDecoratorWindow window;
-};
-
-int main(int argc, char **argv)
-{
- MDecoratorApp app(argc, argv);
-
- return app.exec();
-}
--- a/decorators/mdecorator/mdecorator.pro
+++ /dev/null
@@ -1,17 +0,0 @@
-include(../../meegotouch_config.pri)
-TEMPLATE = app
-DEPENDPATH += .
-INCLUDEPATH += . ../libdecorator
-CONFIG += meegotouch release
-QT += opengl dbus
-
-LIBS += ../libdecorator/libdecorator.so
-
-SOURCES += main.cpp mdecoratorwindow.cpp
-HEADERS += mdecoratorwindow.h
-
-QMAKE_EXTRA_TARGETS += check
-check.depends = $$TARGET
-check.commands = $$system(true)
-target.path = /usr/bin
-INSTALLS += target
--- a/decorators/mdecorator/mdecoratorwindow.cpp
+++ /dev/null
@@ -1,671 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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 <QtDebug>
-
-#include <MSceneManager>
-#include <MScene>
-#include <MApplicationMenu>
-#include <MApplicationPage>
-#include <MLabel>
-#include <QGraphicsLinearLayout>
-#include <mbutton.h>
-#include <mwidgetaction.h>
-#include <mcomponentdata.h>
-#include "mondisplaychangeevent.h"
-
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QX11Info>
-#include <QGLFormat>
-#include <QGLWidget>
-#include <QLabel>
-#include <QWindowStateChangeEvent>
-#include <QSettings>
-
-#include "mdecoratorwindow.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xatom.h>
-#include <X11/Xmd.h>
-#include <X11/extensions/Xfixes.h>
-#include <X11/extensions/shape.h>
-
-#include <mabstractdecorator.h>
-#include <mabstractappinterface.h>
-#include <mdesktopentry.h>
-#include <mbuttonmodel.h>
-#include <mdeviceprofile.h>
-
-class MDecorator: public MAbstractDecorator
-{
- Q_OBJECT
-public:
- MDecorator(MDecoratorWindow *p)
- : MAbstractDecorator(p),
- decorwindow(p)
- {
- }
-
- ~MDecorator() {
- }
-
- virtual void manageEvent(Qt::HANDLE window)
- {
- XTextProperty p;
- QString title;
-
- if (window && XGetWMName(QX11Info::display(), window, &p)) {
- title = (char*) p.value;
- XFree(p.value);
- }
- decorwindow->managedWindowChanged(window);
- decorwindow->setInputRegion();
- setAvailableGeometry(decorwindow->availableClientRect());
- decorwindow->setWindowTitle(title);
- }
-
-protected:
- virtual void activateEvent() {
- }
-
- virtual void showQueryDialog(bool visible) {
- decorwindow->showQueryDialog(visible);
- }
-
- virtual void setAutoRotation(bool mode)
- {
- Q_UNUSED(mode)
- // we follow the orientation of the topmost app
- }
-
- virtual void setOnlyStatusbar(bool mode)
- {
- decorwindow->setOnlyStatusbar(mode);
- decorwindow->setInputRegion();
- setAvailableGeometry(decorwindow->availableClientRect());
- }
-
-private:
-
- MDecoratorWindow *decorwindow;
-};
-
-class MDecoratorAppInterface : public MAbstractAppInterface
-{
- Q_OBJECT
-
-public:
- MDecoratorAppInterface(MDecoratorWindow *p)
- : MAbstractAppInterface(p)
- , decorwindow(p)
- {
- }
-
- void setManagedWindow(WId window)
- {
- currentWindow = window;
- }
-
- virtual void actionsChanged(QList<MDecoratorIPCAction> newMenu, WId window)
- {
- if (window != currentWindow)
- return;
-
- QList<MAction*> menu;
- actionHash.clear();
-
- foreach (MDecoratorIPCAction act, newMenu) {
- MAction* mact = createMAction(act);
- menu.append(mact);
- }
- decorwindow->addActions(menu);
- }
-
-public slots:
- void actionTriggered(bool val)
- {
- if (!sender() || !qobject_cast<MAction*>(sender()))
- return;
-
- MAction* act = static_cast<MAction*>(sender());
- if (actionHash.contains(act))
- emit triggered(actionHash.value(act).id().toString(), val);
- }
-
- void actionToggled(bool val)
- {
- if (!sender() || !qobject_cast<MAction*>(sender()))
- return;
-
- MAction* act = static_cast<MAction*>(sender());
- if (actionHash.contains(act))
- emit toggled(actionHash.value(act).id().toString(), val);
- }
-
-private:
-
- MAction* createMAction(const MDecoratorIPCAction& act)
- {
- //Normal MActions doesn't support custom QIcons, therefore we use MButtons and MWidgetAction
-
- MAction* mact;
- if (act.type() == MDecoratorIPCAction::MenuAction) {
- mact = new MAction(decorwindow);
- mact->setText(act.text());
- mact->setCheckable(act.isCheckable());
- mact->setChecked(act.isChecked());
- mact->setIcon(act.icon());
- mact->setLocation(MAction::ApplicationMenuLocation);
- } else {
- mact = new MWidgetAction(decorwindow);
- MButton* mbut = new MButton;
- mbut->setMinimumSize(0, 0);
- mbut->setObjectName("toolbaractioncommand");
- mbut->setIcon(act.icon());
- if (act.icon().isNull())
- mbut->setText(act.text());
- static_cast<MWidgetAction*>(mact)->setWidget(mbut);
- mact->setText(act.text());
- mact->setCheckable(act.isCheckable());
- mact->setChecked(act.isChecked());
- mact->setLocation(MAction::ToolBarLocation);
-
- updateViewAndStyling(mbut, false);
-
- if (act.isCheckable())
- connect(mbut, SIGNAL(toggled(bool)), mact, SIGNAL(toggled(bool)));
- else
- connect(mbut, SIGNAL(clicked(bool)), mact, SIGNAL(triggered(bool)));
- }
- connect(mact, SIGNAL(triggered(bool)), SLOT(actionTriggered(bool)));
- connect(mact, SIGNAL(toggled(bool)), SLOT(actionToggled(bool)));
-
- actionHash[mact] = act;
- return mact;
- }
-
- //This method is copied from libmeegotouch (MApplicationMenuView), but slightly changed
- void updateViewAndStyling(MButton *button, bool buttonGroup) const
- {
- QString toolBarButtonDefaultViewType = buttonGroup ? "toolbartab" : "toolbar";
-
- if (button && button->icon().isNull()) {
- // Only label -> could use different styling
- button->setTextVisible(true); //In this case we will show label (as it is all we have)
- if (button->viewType() != toolBarButtonDefaultViewType)
- button->setViewType(toolBarButtonDefaultViewType);
- button->setStyleName("ToolBarLabelOnlyButton");
- } else {
- if (button->viewType() != toolBarButtonDefaultViewType)
- button->setViewType(toolBarButtonDefaultViewType);
- button->setStyleName("ToolBarIconButton");
- button->setTextVisible(true);
- }
- }
-
- QHash<MAction*, MDecoratorIPCAction> actionHash;
-
- MDecoratorWindow *decorwindow;
- WId currentWindow;
-};
-
-#if 0
-static QRect windowRectFromGraphicsItem(const QGraphicsView &view,
- const QGraphicsItem &item)
-{
- return view.mapFromScene(
- item.mapToScene(
- item.boundingRect()
- )
- ).boundingRect();
-}
-#endif
-
-MDecoratorWindow::MDecoratorWindow(QWidget *parent)
- : MApplicationWindow(parent),
- homeButtonPanel(0),
- escapeButtonPanel(0),
- navigationBar(0),
- statusBar(0),
- messageBox(0),
- managed_window(0),
- menuVisible(false)
-{
- locale.addTranslationPath(TRANSLATION_INSTALLDIR);
- locale.installTrCatalog("recovery");
- locale.setDefault(locale);
-
- onlyStatusbarAtom = XInternAtom(QX11Info::display(),
- "_MDECORATOR_ONLY_STATUSBAR", False);
- managedWindowAtom = XInternAtom(QX11Info::display(),
- "_MDECORATOR_MANAGED_WINDOW", False);
-
- foreach (QGraphicsItem* item, items()) {
- if (!homeButtonPanel) {
- homeButtonPanel = dynamic_cast<MHomeButtonPanel*>(item);
- if (homeButtonPanel)
- continue;
- }
- if (!escapeButtonPanel) {
- escapeButtonPanel = dynamic_cast<MEscapeButtonPanel*>(item);
- if (escapeButtonPanel)
- continue;
- }
- if (!navigationBar) {
- navigationBar = dynamic_cast<MNavigationBar*>(item);
- if (navigationBar)
- continue;
- }
- if (!statusBar) {
- statusBar = dynamic_cast<MStatusBar*>(item);
- if (statusBar) {
- continue;
- }
- }
- }
-
- // Check for presence of homeButtonPanel and navigationBar, statusBar can be NULL
- if (!homeButtonPanel || !navigationBar)
- qFatal("Meego elements not found");
-
- homeButtonPanel = new MHomeButtonPanel();
- connect(homeButtonPanel, SIGNAL(buttonClicked()), this,
- SIGNAL(homeClicked()));
- if (escapeButtonPanel)
- connect(escapeButtonPanel, SIGNAL(buttonClicked()), this,
- SIGNAL(escapeClicked()));
-
- connect(navigationBar, SIGNAL(viewmenuTriggered()), SLOT(menuAppearing()));
- connect(navigationBar, SIGNAL(closeButtonClicked()), SIGNAL(escapeClicked()));
-
- /*sceneManager()->appearSceneWindowNow(statusBar);
- sceneManager()->appearSceneWindowNow(menu);*/
- setOnlyStatusbar(false);
- requested_only_statusbar = false;
-
- d = new MDecorator(this);
- app = new MDecoratorAppInterface(this);
-
- connect(this, SIGNAL(homeClicked()), d, SLOT(minimize()));
- connect(this, SIGNAL(escapeClicked()), d, SLOT(close()));
- connect(sceneManager(),
- SIGNAL(orientationChanged(M::Orientation)),
- this,
- SLOT(screenRotated(M::Orientation)));
-
- setTranslucentBackground(true); // for translucent messageBox
- setFocusPolicy(Qt::NoFocus);
- setSceneSize();
- setMDecoratorWindowProperty();
-
- setInputRegion();
- setProperty("followsCurrentApplicationWindowOrientation", true);
-}
-
-void MDecoratorWindow::yesButtonClicked()
-{
- d->queryDialogAnswer(managed_window, true);
- showQueryDialog(false);
-}
-
-void MDecoratorWindow::noButtonClicked()
-{
- d->queryDialogAnswer(managed_window, false);
- showQueryDialog(false);
-}
-
-void MDecoratorWindow::managedWindowChanged(Qt::HANDLE w)
-{
- app->setManagedWindow(w);
- app->actionsChanged(QList<MDecoratorIPCAction>(), w);
- if (w != managed_window && messageBox)
- showQueryDialog(false);
- managed_window = w;
-}
-
-void MDecoratorWindow::setWindowTitle(const QString& title)
-{
- navigationBar->setViewMenuDescription(title);
-}
-
-MDecoratorWindow::~MDecoratorWindow()
-{
-}
-
-bool MDecoratorWindow::x11Event(XEvent *e)
-{
- Atom actual;
- int format, result;
- unsigned long n, left;
- unsigned char *data = 0;
- if (e->type == PropertyNotify
- && ((XPropertyEvent*)e)->atom == onlyStatusbarAtom) {
- result = XGetWindowProperty(QX11Info::display(), winId(),
- onlyStatusbarAtom, 0, 1, False,
- XA_CARDINAL, &actual, &format,
- &n, &left, &data);
- if (result == Success && data) {
- bool val = *((long*)data);
- if (val != only_statusbar)
- d->RemoteSetOnlyStatusbar(val);
- }
- if (data)
- XFree(data);
- return true;
- } else if (e->type == PropertyNotify
- && ((XPropertyEvent*)e)->atom == managedWindowAtom) {
- result = XGetWindowProperty(QX11Info::display(), winId(),
- managedWindowAtom, 0, 1, False,
- XA_WINDOW, &actual, &format,
- &n, &left, &data);
- if (result == Success && data)
- d->RemoteSetManagedWinId(*((long*)data));
- if (data)
- XFree(data);
- return true;
- } else if (e->type == VisibilityNotify) {
- XVisibilityEvent *xevent = (XVisibilityEvent *) e;
-
- switch (xevent->state) {
- case VisibilityFullyObscured:
- setWindowVisibility(xevent->window, false);
- break;
- case VisibilityUnobscured:
- case VisibilityPartiallyObscured:
- setWindowVisibility(xevent->window, true);
- break;
- default:
- break;
- }
- }
- return false;
-}
-
-void MDecoratorWindow::setWindowVisibility(Window window, bool visible)
-{
- Q_FOREACH(MWindow * win, MComponentData::instance()->windows()) {
- if (win && win->effectiveWinId() == window) {
- MOnDisplayChangeEvent ev(visible, QRectF(QPointF(0, 0), win->visibleSceneSize()));
- QApplication::instance()->sendEvent(win, &ev);
- }
- }
-}
-
-void MDecoratorWindow::showQueryDialog(bool visible)
-{
- if (visible && !messageBox) {
- QString name;
-
- XClassHint cls = {0, 0};
- XGetClassHint(QX11Info::display(), managed_window, &cls);
- if (cls.res_name) {
- name = QString(cls.res_name);
- if (name.endsWith(".launch"))
- // Remove the extension in order to find the .desktop file.
- name.resize(name.length()-strlen(".launch"));
- MDesktopEntry de(QString("/usr/share/applications/")
- + name + ".desktop");
- if (de.isValid() && !de.name().isEmpty())
- name = de.name();
- XFree(cls.res_name);
- } else
- name.sprintf("window 0x%lx", managed_window);
-
- if (cls.res_class)
- XFree(cls.res_class);
-
- XSetTransientForHint(QX11Info::display(), winId(), managed_window);
- requested_only_statusbar = only_statusbar;
- setOnlyStatusbar(true, true);
- messageBox = new MMessageBox("", "", M::NoStandardButton);
- messageBox->setCentralWidget(new QGraphicsWidget(messageBox));
- QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical,
- messageBox->centralWidget());
- MLabel *title = new MLabel(
- qtTrId("qtn_reco_app_not_responding").arg(name),
- messageBox);
- title->setStyleName("CommonQueryTitle");
- title->setWordWrap(true);
- title->setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
- title->setAlignment(Qt::AlignCenter);
- layout->addItem(title);
- MLabel *text = new MLabel(qtTrId("qtn_reco_close_app_question"),
- messageBox);
- text->setStyleName("CommonQueryText");
- text->setWordWrap(true);
- text->setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
- text->setAlignment(Qt::AlignCenter);
- layout->addItem(text);
- messageBox->centralWidget()->setLayout(layout);
- MButtonModel *yes = messageBox->addButton(qtTrId("qtn_comm_command_yes"),
- M::AcceptRole);
- MButtonModel *no = messageBox->addButton(qtTrId("qtn_comm_command_no"),
- M::RejectRole);
- connect(yes, SIGNAL(clicked()), this, SLOT(yesButtonClicked()));
- connect(no, SIGNAL(clicked()), this, SLOT(noButtonClicked()));
- sceneManager()->appearSceneWindowNow(messageBox);
- } else if (!visible && messageBox) {
- XSetTransientForHint(QX11Info::display(), winId(), None);
- sceneManager()->disappearSceneWindowNow(messageBox);
- delete messageBox;
- messageBox = 0;
- setOnlyStatusbar(requested_only_statusbar);
- }
- setInputRegion();
- update();
-}
-
-void MDecoratorWindow::setOnlyStatusbar(bool mode, bool temporary)
-{
- if (mode) {
- sceneManager()->disappearSceneWindowNow(navigationBar);
- sceneManager()->disappearSceneWindowNow(homeButtonPanel);
- if (escapeButtonPanel)
- sceneManager()->disappearSceneWindowNow(escapeButtonPanel);
- } else if (!messageBox) {
- sceneManager()->appearSceneWindowNow(navigationBar);
- sceneManager()->appearSceneWindowNow(homeButtonPanel);
- if (escapeButtonPanel)
- sceneManager()->appearSceneWindowNow(escapeButtonPanel);
- }
- if (!temporary)
- requested_only_statusbar = mode;
- only_statusbar = mode;
-}
-
-void MDecoratorWindow::screenRotated(const M::Orientation &orientation)
-{
- Q_UNUSED(orientation);
- setInputRegion();
- d->setAvailableGeometry(availableClientRect());
-}
-
-void MDecoratorWindow::setInputRegion()
-{
- static QRegion prev_region;
- QRegion region;
- const QRegion fs(QApplication::desktop()->screenGeometry());
- // region := decoration region
- if (messageBox || menuVisible) {
- //TODO Is this correct? returns empty region: availableRect = (fs - region)
- // Occupy all space.
- region = fs;
- } else {
- // Decoration includes the status bar, and possibly other elements.
- QRect sbrect;
- if (statusBar) {
- sbrect = statusBar->sceneBoundingRect().toRect();
- sbrect.setHeight(statusBar->property("sharedPixmapHeight").value<qreal>());
- }
- region = sbrect;
-
- if (!only_statusbar) {
- region += navigationBar->sceneBoundingRect().toRect();
- region += homeButtonPanel->sceneBoundingRect().toRect();
- if (escapeButtonPanel)
- region += escapeButtonPanel->sceneBoundingRect().toRect();
- }
-
- // The coordinates we receive from libmeegotouch are rotated
- // by @angle. Map @retion back to screen coordinates.
- int angle = sceneManager()->orientationAngle();
- if (angle != 0) {
- QTransform trans;
- const QRect fs(QApplication::desktop()->screenGeometry());
-
- trans.rotate(angle);
- if (angle == 270)
- trans.translate(-fs.height(), 0);
- else if (angle == 180)
- trans.translate(-fs.width(), -fs.height());
- else if (angle == 90)
- trans.translate(0, -fs.width());
- region = trans.map(region);
- }
- }
-
- // Set our input and bounding shape to @region if changed.
- if (prev_region != region) {
- prev_region = region;
-
- // Convert @region to @xrects.
- const QVector<QRect> rects = region.rects();
- int nxrects = rects.count();
- XRectangle *xrects = new XRectangle[nxrects];
- for (int i = 0; i < nxrects; ++i) {
- xrects[i].x = rects[i].x();
- xrects[i].y = rects[i].y();
- xrects[i].width = rects[i].width();
- xrects[i].height = rects[i].height();
- }
-
- Display *dpy = QX11Info::display();
- XserverRegion shapeRegion = XFixesCreateRegion(dpy, xrects, nxrects);
- XFixesSetWindowShapeRegion(dpy, winId(), ShapeInput,
- 0, 0, shapeRegion);
- XFixesSetWindowShapeRegion(dpy, winId(), ShapeBounding,
- 0, 0, shapeRegion);
-
- XFixesDestroyRegion(dpy, shapeRegion);
- delete[] xrects;
- }
-
- // The rectangle available for the application is the largest square
- // on the screen not covered by decoration completely.
- availableRect = (fs - region).boundingRect();
-}
-
-void MDecoratorWindow::setSceneSize()
-{
- // always keep landscape size
- Display *dpy = QX11Info::display();
- int xres = ScreenOfDisplay(dpy, DefaultScreen(dpy))->width;
- int yres = ScreenOfDisplay(dpy, DefaultScreen(dpy))->height;
- scene()->setSceneRect(0, 0, xres, yres);
- setMinimumSize(xres, yres);
- setMaximumSize(xres, yres);
-}
-
-void MDecoratorWindow::setMDecoratorWindowProperty()
-{
-
- long on = 1;
-
- XChangeProperty(QX11Info::display(), winId(),
- XInternAtom(QX11Info::display(), "_MEEGOTOUCH_DECORATOR_WINDOW", False),
- XA_CARDINAL,
- 32, PropModeReplace,
- (unsigned char *) &on, 1);
-}
-
-
-const QRect MDecoratorWindow::availableClientRect() const
-{
- return availableRect;
-}
-
-void MDecoratorWindow::closeEvent(QCloseEvent * event )
-{
- // never close the decorator!
- return event->ignore();
-}
-
-void MDecoratorWindow::addActions(QList<MAction*> new_actions)
-{
- setUpdatesEnabled(false);
-
- navigationBar->setArrowIconVisible(false);
-
- QList<QAction*> oldactions = actions();
-
- foreach (QAction* act, oldactions)
- removeAction(act);
-
- foreach (MAction* act, new_actions) {
- //the signals have to be disabled because LMT using setChecked on the action and that would lead to an trigger/toggle signal
- act->blockSignals(true);
- if (act->location() == MAction::ApplicationMenuLocation)
- navigationBar->setArrowIconVisible(true);
- this->addAction(act);
- act->blockSignals(false);
- }
-
-
-
- setUpdatesEnabled(true);
-}
-
-void MDecoratorWindow::menuAppearing()
-{
- if (menuVisible)
- return;
-
- foreach (QGraphicsItem* item, items()) {
- MApplicationMenu *menu = dynamic_cast<MApplicationMenu*>(item);
- if (menu) {
- connect(menu, SIGNAL(disappeared()), SLOT(menuDisappeared()));
- connect(this, SIGNAL(displayExited()), menu, SLOT(disappear()));
-
- menuVisible = true;
- }
- }
-
- // Only if menu exists, or menuDisappeared never called
- if (menuVisible) {
- QPixmap pix = QPixmap::grabWindow(winId());
- setBackgroundBrush(pix);
-
- setInputRegion();
- }
-}
-
-void MDecoratorWindow::menuDisappeared()
-{
- if (!menuVisible)
- return;
- menuVisible=false;
- setInputRegion();
- setBackgroundBrush(QBrush(Qt::NoBrush));
-}
-
-
-
-#include "mdecoratorwindow.moc"
--- a/decorators/mdecorator/mdecoratorwindow.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/***************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (directui@nokia.com)
-**
-** This file is part of duicompositor.
-**
-** 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.
-**
-****************************************************************************/
-#ifndef MDECORATORWINDOW_H
-#define MDECORATORWINDOW_H
-
-#include <MApplicationWindow>
-#include <MHomeButtonPanel>
-#include <MEscapeButtonPanel>
-#include <MNavigationBar>
-#include <MMessageBox>
-#include <mstatusbar.h>
-#include <mlocale.h>
-
-#include <X11/Xlib.h>
-#ifdef HAVE_SHAPECONST
-#include <X11/extensions/shapeconst.h>
-#else
-#include <X11/extensions/shape.h>
-#endif
-
-#include <QObject>
-
-class MSceneManager;
-class MDecorator;
-class MAction;
-class MApplicationMenu;
-class MDecoratorAppInterface;
-
-class MDecoratorWindow : public MApplicationWindow
-{
- Q_OBJECT
-
-public:
- explicit MDecoratorWindow(QWidget *parent = 0);
- virtual ~MDecoratorWindow();
-
- const QRect availableClientRect() const;
- bool x11Event(XEvent *e);
- void setWindowTitle(const QString& title);
- void setOnlyStatusbar(bool mode, bool temporary = false);
- /*!
- * \brief Sets the region of the window that can receive input events.
- *
- * Input events landing on the area outside this region will fall directly
- * to the windows below.
- */
- void setInputRegion();
- void managedWindowChanged(Qt::HANDLE);
- void showQueryDialog(bool visible);
- void addActions(QList<MAction*> actions);
-
-protected:
- virtual void closeEvent(QCloseEvent * event );
-
-private slots:
-
- void screenRotated(const M::Orientation &orientation);
- void yesButtonClicked();
- void noButtonClicked();
- void menuAppearing();
- void menuDisappeared();
-
-signals:
-
- void homeClicked();
- void escapeClicked();
-
-private:
- void setWindowVisibility(Window window, bool visible);
- void setSceneSize();
- void setMDecoratorWindowProperty();
-
- MHomeButtonPanel *homeButtonPanel;
- MEscapeButtonPanel *escapeButtonPanel;
- MNavigationBar *navigationBar;
- MStatusBar *statusBar;
- MMessageBox *messageBox;
- Window managed_window;
- QRect availableRect; // available area for the managed window
- bool only_statusbar, requested_only_statusbar;
- Atom onlyStatusbarAtom, managedWindowAtom;
- MDecorator *d;
- MDecoratorAppInterface *app;
- MLocale locale;
- bool menuVisible;
-
-
- Q_DISABLE_COPY(MDecoratorWindow);
-};
-
-#endif
--- a/mcompositor.pro
+++ b/mcompositor.pro
@@ -1,13 +1,10 @@
TEMPLATE = subdirs
CONFIG+=ordered
SUBDIRS = \
- decorators \
src \
mcompositor\
- tests \
- translations
-
-src.depends=decorators
+ tests
+# translations
QMAKE_CLEAN += \
configure-stamp \
--- a/mcompositor/mcompositor.pro
+++ b/mcompositor/mcompositor.pro
@@ -5,7 +5,7 @@ TARGET =
DEPENDPATH += .
INCLUDEPATH += ../src
-LIBS += ../src/libmcompositor.so ../decorators/libdecorator/libdecorator.so
+LIBS += ../src/libmcompositor.so
target.path += $$M_INSTALL_BIN
INSTALLS += target
--- a/src/mcompatoms_p.h
+++ b/src/mcompatoms_p.h
@@ -37,7 +37,6 @@ public:
INPUT,
ABOVE,
NOTIFICATION,
- DECORATOR,
UNKNOWN
};
@@ -88,7 +87,6 @@ public:
WM_CHANGE_STATE,
// MEEGO(TOUCH)-specific
- _MEEGOTOUCH_DECORATOR_WINDOW,
_MEEGOTOUCH_GLOBAL_ALPHA,
_MEEGOTOUCH_VIDEO_ALPHA,
_MEEGO_STACKING_LAYER,
@@ -124,7 +122,6 @@ public:
};
static MCompAtoms *instance();
Type windowType(Window w);
- bool isDecorator(Window w);
int getPid(Window w);
bool hasState(Window w, Atom a);
QVector<Atom> getAtomArray(Window w, Atom array_atom);
--- a/src/mcompositemanager.cpp
+++ b/src/mcompositemanager.cpp
@@ -22,13 +22,10 @@
#include "mcompositemanager.h"
#include "mcompositemanager_p.h"
#include "mcompositescene.h"
-#include "msimplewindowframe.h"
-#include "mdecoratorframe.h"
#include "mdevicestate.h"
#include "mcompositemanagerextension.h"
#include "mcompmgrextensionfactory.h"
#include "mcompositordebug.h"
-#include <mrmiserver.h>
#include <QX11Info>
#include <QByteArray>
@@ -189,7 +186,6 @@ MCompAtoms::MCompAtoms()
"_NET_CLIENT_LIST_STACKING",
"WM_CHANGE_STATE",
- "_MEEGOTOUCH_DECORATOR_WINDOW",
"_MEEGOTOUCH_GLOBAL_ALPHA",
"_MEEGOTOUCH_VIDEO_ALPHA",
"_MEEGO_STACKING_LAYER",
@@ -265,10 +261,6 @@ MCompAtoms::Type MCompAtoms::windowType(
return NORMAL;
}
-bool MCompAtoms::isDecorator(Window w)
-{
- return (cardValueProperty(w, atoms[_MEEGOTOUCH_DECORATOR_WINDOW]) == 1);
-}
int MCompAtoms::getPid(Window w)
{
@@ -470,18 +462,22 @@ static void fullscreen_wm_state(MComposi
(unsigned char *) states.data(), states.size());
}
- MCompositeWindow *win = MCompositeWindow::compositeWindow(window);
- if (win)
- win->propertyCache()->setNetWmState(states.toList());
- if (win && priv->needDecoration(window, win->propertyCache()))
- win->setDecorated(true);
- if (win && !MDecoratorFrame::instance()->managedWindow()
- && win->needDecoration()) {
- MDecoratorFrame::instance()->setManagedWindow(win);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- MDecoratorFrame::instance()->show();
+ MWindowPropertyCache *pc = 0;
+
+ if (priv->prop_caches.contains(window))
+ pc = priv->prop_caches.value(window);
+
+ if (pc)
+ pc->setNetWmState(states.toList());
+
+ /* FIXME: This needs to be re-implemented
+ if (win && need_geometry_modify(window) &&
+ !availScreenRect.isEmpty()) {
+ QRect r = availScreenRect;
+ XMoveResizeWindow(dpy, window, r.x(), r.y(), r.width(), r.height());
}
- if (win && win->propertyCache()->isMapped())
+ */
+ if (pc && pc->isMapped())
priv->dirtyStacking(false);
} break;
case 1: /* add */ {
@@ -496,19 +492,16 @@ static void fullscreen_wm_state(MComposi
int yres = ScreenOfDisplay(dpy, DefaultScreen(dpy))->height;
XMoveResizeWindow(dpy, window, 0, 0, xres, yres);
MOVE_RESIZE(window, 0, 0, xres, yres);
- MCompositeWindow *win = priv->windows.value(window, 0);
- if (win) {
- win->propertyCache()->setRequestedGeometry(QRect(0, 0, xres, yres));
- win->propertyCache()->setNetWmState(states.toList());
- }
- if (win && !priv->device_state->ongoingCall())
- win->setDecorated(false);
- if (!priv->device_state->ongoingCall()
- && MDecoratorFrame::instance()->managedWindow() == window) {
- MDecoratorFrame::instance()->hide();
- MDecoratorFrame::instance()->setManagedWindow(0);
+ MWindowPropertyCache *pc = 0;
+
+ if (priv->prop_caches.contains(window))
+ pc = priv->prop_caches.value(window);
+
+ if (pc) {
+ pc->setRequestedGeometry(QRect(0, 0, xres, yres));
+ pc->setNetWmState(states.toList());
}
- if (win && win->propertyCache()->isMapped())
+ if (pc && pc->isMapped())
priv->dirtyStacking(false);
} break;
case 2: /* toggle */ {
@@ -760,7 +753,6 @@ static void setup_key_grabs()
void MCompositeManagerPrivate::prepare()
{
- MDecoratorFrame::instance();
watch->prepareRoot();
Window w;
QString wm_name = "MCompositor";
@@ -845,53 +837,6 @@ int MCompositeManagerPrivate::loadPlugin
return nloaded;
}
-bool MCompositeManagerPrivate::needDecoration(Window window,
- MWindowPropertyCache *pc)
-{
- bool fs;
- if (pc && pc->isInputOnly())
- return false;
- if (!pc)
- fs = atom->hasState(window, ATOM(_NET_WM_STATE_FULLSCREEN));
- else
- fs = pc->netWmState().indexOf(ATOM(_NET_WM_STATE_FULLSCREEN)) != -1;
- if (device_state->ongoingCall() && fs && ((pc &&
- pc->windowTypeAtom() != ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE) &&
- pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_MENU)) ||
- (!pc && atom->windowType(window) != MCompAtoms::FRAMELESS)))
- // fullscreen window is decorated during call
- return true;
- if (fs)
- return false;
- bool transient;
- if (!pc)
- transient = transient_for(window);
- else
- transient = (getLastVisibleParent(pc) ? true : false);
- if (!pc && atom->isDecorator(window))
- return false;
- else if (pc && (pc->isDecorator() || pc->isOverrideRedirect()))
- return false;
- else if (!pc) {
- XWindowAttributes a;
- if (!XGetWindowAttributes(QX11Info::display(), window, &a)
- || a.override_redirect || a.c_class == InputOnly)
- return false;
- }
- MCompAtoms::Type t;
- if (!pc)
- t = atom->windowType(window);
- else
- t = pc->windowType();
- return (t != MCompAtoms::FRAMELESS
- && t != MCompAtoms::DESKTOP
- && t != MCompAtoms::NOTIFICATION
- && t != MCompAtoms::INPUT
- && t != MCompAtoms::DOCK
- && t != MCompAtoms::NO_DECOR_DIALOG
- && (!transient || t == MCompAtoms::DIALOG));
-}
-
void MCompositeManagerPrivate::damageEvent(XDamageNotifyEvent *e)
{
XDamageSubtract(QX11Info::display(), e->damage, None, None);
@@ -920,18 +865,9 @@ void MCompositeManagerPrivate::destroyEv
// PC deleted with the MCompositeWindow. Till then we've made sure
// that we can't reuse it, even if a window with the same XID is
// created before @item is actually destroyed.
- } else {
- // We got a destroy event from a framed window (or a window that was
- // never mapped)
- FrameData fd = framed_windows.value(e->window);
- if (fd.frame) {
- framed_windows.remove(e->window);
- delete fd.frame;
- }
- if (prop_caches.contains(e->window)) {
+ } else if (prop_caches.contains(e->window)) {
delete prop_caches.value(e->window);
prop_caches.remove(e->window);
- }
}
}
@@ -945,9 +881,6 @@ void MCompositeManagerPrivate::propertyE
if (pc->propertyEvent(e) && pc->isMapped()) {
changed_properties = true; // property change can affect stacking order
- if (pc->isDecorator())
- // in case decorator's transiency changes, make us update the value
- pc->transientFor();
dirtyStacking(false, e->time);
MCompositeWindow *cw = COMPOSITE_WINDOW(e->window);
if (cw && !cw->isNewlyMapped()) {
@@ -1050,29 +983,6 @@ Window MCompositeManagerPrivate::getTopm
return 0;
}
-MCompositeWindow *MCompositeManagerPrivate::getHighestDecorated(int *index)
-{
- for (int i = stacking_list.size() - 1; i >= 0; --i) {
- Window w = stacking_list.at(i);
- if (w == stack[DESKTOP_LAYER])
- break;
- MCompositeWindow *cw = COMPOSITE_WINDOW(w);
- MWindowPropertyCache *pc;
- if (cw && cw->isMapped() && (pc = cw->propertyCache()) &&
- !pc->isOverrideRedirect() &&
- (cw->needDecoration() || cw->status() == MCompositeWindow::Hung
- || (FULLSCREEN_WINDOW(cw) &&
- pc->windowTypeAtom() != ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE)
- && pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_MENU)
- && device_state->ongoingCall()))) {
- if (index) *index = i;
- return cw;
- }
- }
- if (index) *index = -1;
- return 0;
-}
-
bool MCompositeManagerPrivate::haveMappedWindow() const
{
for (int i = stacking_list.size() - 1; i >= 0; --i) {
@@ -1110,8 +1020,6 @@ bool MCompositeManagerPrivate::possiblyU
// this window is unmapped and has unmap animation going on
return false;
if (cw->isMapped() && (cw->propertyCache()->hasAlpha()
- || cw->needDecoration()
- || cw->propertyCache()->isDecorator()
// FIXME: implement direct rendering for shaped windows
|| !fs_r.subtracted(cw->propertyCache()->shapeRegion()).isEmpty()))
// this window prevents direct rendering
@@ -1220,40 +1128,6 @@ void MCompositeManagerPrivate::unmapEven
setWindowState(e->window, WithdrawnState);
if (item->isVisible() && !item->isClosing())
item->setVisible(false);
-
- if (MDecoratorFrame::instance()->managedWindow() == e->window) {
- // decorate next window in the stack if any
- MCompositeWindow *cw = getHighestDecorated();
- if (!cw) {
- MDecoratorFrame::instance()->hide();
- MDecoratorFrame::instance()->setManagedWindow(0);
- positionWindow(MDecoratorFrame::instance()->winId(), false);
- } else {
- if (cw->status() == MCompositeWindow::Hung) {
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- } else if (FULLSCREEN_WINDOW(cw) && device_state->ongoingCall()) {
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- } else {
- MDecoratorFrame::instance()->setManagedWindow(cw);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- }
- }
- }
- } else {
- // We got an unmap event from a framed window
- FrameData fd = framed_windows.value(e->window);
- if (!fd.frame)
- return;
- // make sure we reparent first before deleting the window
- XGrabServer(QX11Info::display());
- XReparentWindow(QX11Info::display(), e->window,
- RootWindow(QX11Info::display(), 0), 0, 0);
- setWindowState(e->window, IconicState);
- framed_windows.remove(e->window);
- XUngrabServer(QX11Info::display());
- delete fd.frame;
}
updateWinList();
@@ -1291,28 +1165,9 @@ void MCompositeManagerPrivate::configure
Window above = e->above;
if (above != None) {
- if (item->needDecoration() &&
- MDecoratorFrame::instance()->decoratorItem() &&
- MDecoratorFrame::instance()->managedWindow() == e->window) {
- if (FULLSCREEN_WINDOW(item) &&
- item->status() != MCompositeWindow::Hung) {
- // ongoing call case
- MDecoratorFrame::instance()->setManagedWindow(item, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- } else {
- MDecoratorFrame::instance()->setManagedWindow(item);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- }
- MDecoratorFrame::instance()->show();
- item->update();
- dirtyStacking(check_visibility);
- check_visibility = false;
- } else
- dirtyStacking(check_visibility);
+ dirtyStacking(check_visibility);
} else {
// FIXME: seems that this branch is never executed?
- if (e->window == MDecoratorFrame::instance()->managedWindow())
- MDecoratorFrame::instance()->hide();
// item->setIconified(true);
// ensure ZValue is set only after the animation is done
item->requestZValue(0);
@@ -1433,11 +1288,6 @@ void MCompositeManagerPrivate::configure
MWindowPropertyCache *pc = 0;
if (prop_caches.contains(e->window))
pc = prop_caches.value(e->window);
-
- // sandbox these windows. we own them
- if ((pc && pc->isDecorator()) || (!pc && atom->isDecorator(e->window)))
- return;
-
/*qDebug() << __func__ << "CONFIGURE REQUEST FOR:" << e->window
<< e->x << e->y << e->width << e->height << "above/mode:"
<< e->above << e->detail;*/
@@ -1474,11 +1324,10 @@ void MCompositeManagerPrivate::configure
// selective compositing support:
// since we call disable compositing immediately
// we don't see the animated transition
- if (!i->propertyCache()->hasAlpha() && !i->needDecoration()) {
+ if (!i->propertyCache()->hasAlpha()) {
i->setIconified(false);
disableCompositing(FORCED);
- } else if (MDecoratorFrame::instance()->managedWindow() == e->window)
- enableCompositing();
+ }
}
}
@@ -1521,28 +1370,15 @@ void MCompositeManagerPrivate::mapReques
RESIZE(e->window, xres, yres);
}
}
+ else if (wtype == MCompAtoms::NORMAL) {
+ fullscreen_wm_state(this, 1, e->window);
+ }
// Composition is enabled by default because we are introducing animations
// on window map. It will be turned off once transitions are done
if (!pc->isInputOnly())
enableCompositing(true);
- if (pc->isDecorator()) {
- MDecoratorFrame::instance()->setDecoratorWindow(e->window);
- MDecoratorFrame::instance()->setManagedWindow(0);
- MCompositeWindow *cw;
- if ((cw = getHighestDecorated())) {
- if (cw->status() == MCompositeWindow::Hung) {
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- } else if (FULLSCREEN_WINDOW(cw) && device_state->ongoingCall()) {
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- } else
- MDecoratorFrame::instance()->setManagedWindow(cw);
- }
- return;
- }
-
#ifdef WINDOW_DEBUG
if (debug_mode) overhead_measure.start();
#endif
@@ -1559,66 +1395,6 @@ void MCompositeManagerPrivate::mapReques
setWindowState(e->window, IconicState);
else
setWindowState(e->window, NormalState);
- if (needDecoration(e->window, pc)) {
- if (MDecoratorFrame::instance()->decoratorItem()) {
- // initially visualize decorator item so selective compositing
- // checks won't disable compositing
- MDecoratorFrame::instance()->show();
- } else {
-#if 0 /* FIXME/TODO: this does NOT work when mdecorator starts after the first
- decorated window is shown. See NB#196194 */
- if (!pc->isInputOnly())
- XAddToSaveSet(QX11Info::display(), e->window);
- // it will be non-toplevel, so mask needs to be set here
- XSelectInput(dpy, e->window,
- StructureNotifyMask | ColormapChangeMask |
- PropertyChangeMask);
- MSimpleWindowFrame *frame = 0;
- FrameData f = framed_windows.value(e->window);
- frame = f.frame;
- if (!frame) {
- frame = new MSimpleWindowFrame(e->window);
- Window trans = transient_for(e->window);
- if (trans)
- frame->setDialogDecoration(true);
-
- // TEST: a framed translucent window
- if (pc->hasAlpha())
- frame->setAttribute(Qt::WA_TranslucentBackground);
- QSize s = frame->suggestedWindowSize();
- XResizeWindow(QX11Info::display(), e->window, s.width(), s.height());
- RESIZE(e->window, s.width(), s.height());
-
- XReparentWindow(QX11Info::display(), frame->winId(),
- RootWindow(QX11Info::display(), 0), 0, 0);
-
- // associate e->window with frame and its parent
- FrameData fd;
- fd.frame = frame;
- fd.mapped = true;
- fd.parentWindow = frame->winId();
- framed_windows[e->window] = fd;
-
- if (trans) {
- FrameData f = framed_windows.value(trans);
- if (f.frame) {
- XSetTransientForHint(QX11Info::display(), frame->winId(),
- f.frame->winId());
- }
- }
- }
-
- XReparentWindow(QX11Info::display(), e->window,
- frame->windowArea(), 0, 0);
- MapRequesterPrivate::instance()->requestMap(pc);
- frame->show();
-
- XSync(QX11Info::display(), False);
-#else
- qWarning("%s: mdecorator hasn't started yet", __func__);
-#endif
- }
- }
}
// Raise @pc's window together with its transiency tree to the top of
@@ -1758,7 +1534,7 @@ void MCompositeManagerPrivate::checkInpu
for (int i = stacking_list.size() - 1; i >= 0; --i) {
Window iw = stacking_list.at(i);
MWindowPropertyCache *pc = prop_caches.value(iw, 0);
- if (!pc || !pc->isMapped() || !pc->wantsFocus() || pc->isDecorator()
+ if (!pc || !pc->isMapped() || !pc->wantsFocus()
|| pc->windowTypeAtom() == ATOM(_NET_WM_WINDOW_TYPE_DOCK))
continue;
if (!pc->isOverrideRedirect() &&
@@ -1983,7 +1759,6 @@ void MCompositeManagerPrivate::checkStac
int last_i = stacking_list.size() - 1;
bool desktop_up = false, fs_app = false;
int app_i = -1;
- MDecoratorFrame *deco = MDecoratorFrame::instance();
MCompositeWindow *aw = 0;
active_app = getTopmostApp(&app_i);
@@ -2039,11 +1814,6 @@ void MCompositeManagerPrivate::checkStac
RAISE_MATCHING(!getLastVisibleParent(cw->propertyCache()) &&
cw->propertyCache()->windowTypeAtom()
== ATOM(_NET_WM_WINDOW_TYPE_DOCK))
- else if (active_app && aw && deco->decoratorItem() &&
- deco->managedWindow() == active_app) {
- // no dock => decorator starts from (0,0)
- XMoveWindow(QX11Info::display(), deco->decoratorItem()->window(), 0, 0);
- }
/* raise all system-modal dialogs */
RAISE_MATCHING(!getLastVisibleParent(cw->propertyCache())
&& MODAL_WINDOW(cw) &&
@@ -2057,7 +1827,6 @@ void MCompositeManagerPrivate::checkStac
/* raise all keep-above flagged, input methods and Meego layer 4
* (incoming call), at the same time preserving their mapping order */
RAISE_MATCHING(!getLastVisibleParent(cw->propertyCache()) &&
- !cw->propertyCache()->isDecorator() &&
cw->propertyCache()->windowState() == NormalState &&
(cw->propertyCache()->windowTypeAtom()
== ATOM(_NET_WM_WINDOW_TYPE_INPUT) ||
@@ -2078,43 +1847,6 @@ void MCompositeManagerPrivate::checkStac
cw->propertyCache()->meegoStackingLayer() == 6
&& cw->propertyCache()->windowState() == NormalState)
- int top_decorated_i;
- MCompositeWindow *highest_d = getHighestDecorated(&top_decorated_i);
- /* raise/lower decorator */
- if (highest_d && top_decorated_i >= 0 && deco->decoratorItem()
- && deco->managedWindow() == highest_d->window()
- && (!FULLSCREEN_WINDOW(highest_d)
- || highest_d->status() == MCompositeWindow::Hung
- || device_state->ongoingCall())) {
- // TODO: would be more robust to set decorator's managed window here
- // instead of in many different places in the code...
- Window deco_w = deco->decoratorItem()->window();
- int deco_i = stacking_list.indexOf(deco_w);
- if (deco_i >= 0) {
- if (deco_i < top_decorated_i) {
- STACKING_MOVE(deco_i, top_decorated_i);
- safe_move(stacking_list, deco_i, top_decorated_i);
- } else {
- STACKING_MOVE(deco_i, top_decorated_i + 1);
- safe_move(stacking_list, deco_i, top_decorated_i + 1);
- }
- if (!compositing)
- // decor requires compositing
- enableCompositing(true);
- deco->decoratorItem()->updateWindowPixmap();
- deco->show();
- glwidget->update();
- }
- } else if ((!highest_d || top_decorated_i < 0) && deco->decoratorItem()) {
- Window deco_w = deco->decoratorItem()->window();
- int deco_i = stacking_list.indexOf(deco_w);
- if (deco_i > 0) {
- STACKING_MOVE(deco_i, 0);
- stacking_list.move(deco_i, 0);
- MDecoratorFrame::instance()->setManagedWindow(0);
- }
- }
-
// properties and focus are updated only if there was a change in the
// order of mapped windows or mappedness FIXME: would make sense to
// stack unmapped windows to the bottom of the stack to avoid them
@@ -2166,8 +1898,7 @@ void MCompositeManagerPrivate::checkStac
for (int i = 0; i <= last_i; ++i) {
MCompositeWindow *witem = COMPOSITE_WINDOW(stacking_list.at(i));
if (witem && witem->isMapped() &&
- (witem->propertyCache()->isOverrideRedirect()
- || witem->propertyCache()->isDecorator()))
+ (witem->propertyCache()->isOverrideRedirect()))
no_decors.removeOne(stacking_list.at(i));
}
XChangeProperty(QX11Info::display(),
@@ -2201,12 +1932,9 @@ void MCompositeManagerPrivate::checkStac
if (cw && cw->isMapped())
pc = cw->propertyCache();
if (cw && cw->isMapped() && !pc->hasAlpha() &&
- !pc->isDecorator() && !cw->hasTransitioningWindow() &&
- // allow input windows to composite their app, see NB#223280
- pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_INPUT) &&
- /* FIXME: decorated window is assumed to be fullscreen */
- (cw->needDecoration() ||
- fs_r.subtracted(pc->shapeRegion()).isEmpty())) {
+ !cw->hasTransitioningWindow() &&
+ pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_INPUT) &&
+ fs_r.subtracted(pc->shapeRegion()).isEmpty()) {
covering_i = i;
break;
}
@@ -2298,7 +2026,7 @@ bool MCompositeManagerPrivate::skipStart
if (w && w == stack[DESKTOP_LAYER])
return false;
if (!(tmp = prop_caches.value(w, 0)) || tmp->isInputOnly()
- || tmp == pc || !tmp->isMapped() || tmp->isDecorator())
+ || tmp == pc || !tmp->isMapped())
continue;
if (tmp->meegoStackingLayer() > pc->meegoStackingLayer())
return true;
@@ -2337,25 +2065,6 @@ void MCompositeManagerPrivate::mapEvent(
wpc->setBeingMapped(false);
wpc->setIsMapped(true);
- FrameData fd = framed_windows.value(win);
- if (fd.frame) {
- QRect a = wpc->realGeometry();
- XConfigureEvent c;
- c.type = ConfigureNotify;
- c.send_event = True;
- c.event = win;
- c.window = win;
- c.x = 0;
- c.y = 0;
- c.width = a.width();
- c.height = a.height();
- c.border_width = 0;
- c.above = stack[DESKTOP_LAYER];
- c.override_redirect = 0;
- XSendEvent(QX11Info::display(), c.event, True, StructureNotifyMask,
- (XEvent *)&c);
- }
-
MCompAtoms::Type wtype = wpc->windowType();
// simple stacking model legacy code...
if (wtype == MCompAtoms::DESKTOP) {
@@ -2366,7 +2075,6 @@ void MCompositeManagerPrivate::mapEvent(
stack[DOCK_LAYER] = win;
} else {
if ((wtype == MCompAtoms::FRAMELESS || wtype == MCompAtoms::NORMAL)
- && !wpc->isDecorator()
&& (wpc->parentWindow() == RootWindow(QX11Info::display(), 0))
&& (e->event == QX11Info::appRootWindow())) {
hideLaunchIndicator();
@@ -2379,7 +2087,7 @@ void MCompositeManagerPrivate::mapEvent(
item->setIsMapped(true);
pc = item->propertyCache();
if (!pc) return;
- if (!pc->isDecorator() && !pc->isOverrideRedirect()
+ if (!pc->isOverrideRedirect()
&& windows_as_mapped.indexOf(win) == -1)
windows_as_mapped.append(win);
}
@@ -2442,16 +2150,6 @@ void MCompositeManagerPrivate::mapEvent(
item->setNewlyMapped(false);
item->setVisible(true);
}
-
- // the current decorated window got mapped
- if (e->window == MDecoratorFrame::instance()->managedWindow() &&
- MDecoratorFrame::instance()->decoratorItem()) {
- connect(item, SIGNAL(visualized(bool)),
- MDecoratorFrame::instance(),
- SLOT(visualizeDecorator(bool)));
- MDecoratorFrame::instance()->show();
- MDecoratorFrame::instance()->decoratorItem()->setZValue(item->zValue() + 1);
- }
setWindowDebugProperties(win);
}
@@ -2504,7 +2202,7 @@ static bool should_be_pinged(MCompositeW
&& pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_NOTIFICATION)
&& pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_DOCK)
&& pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_MENU)
- && !pc->isDecorator() && !pc->isOverrideRedirect()
+ && !pc->isOverrideRedirect()
&& pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_DESKTOP))
return true;
return false;
@@ -2513,7 +2211,6 @@ static bool should_be_pinged(MCompositeW
void MCompositeManagerPrivate::rootMessageEvent(XClientMessageEvent *event)
{
MCompositeWindow *i = COMPOSITE_WINDOW(event->window);
- FrameData fd = framed_windows.value(event->window);
if (event->message_type == ATOM(_NET_ACTIVE_WINDOW)) {
// Visibility notification to desktop window. Ensure this is sent
@@ -2539,10 +2236,6 @@ void MCompositeManagerPrivate::rootMessa
i->restore(iconGeometry, needComp);
}
}
-
- if (fd.frame)
- setWindowState(fd.frame->managedWindow(), NormalState);
- else
setWindowState(event->window, NormalState);
if (event->window == stack[DESKTOP_LAYER]) {
// Mark normal applications on top of home Iconic to make our
@@ -2562,20 +2255,6 @@ void MCompositeManagerPrivate::rootMessa
bool was_hung = ping_source->status() == MCompositeWindow::Hung;
ping_source->receivedPing(event->data.l[1]);
Q_ASSERT(ping_source->status() != MCompositeWindow::Hung);
- Window managed = MDecoratorFrame::instance()->managedWindow();
- if (was_hung && ping_source->window() == managed
- && !ping_source->needDecoration()) {
- MDecoratorFrame::instance()->hide();
- MDecoratorFrame::instance()->setManagedWindow(0);
- MDecoratorFrame::instance()->setAutoRotation(false);
- if(!ping_source->propertyCache()->hasAlpha())
- disableCompositing(FORCED);
- } else if (was_hung && ping_source->window() == managed
- && FULLSCREEN_WINDOW(ping_source)) {
- // ongoing call decorator
- MDecoratorFrame::instance()->setAutoRotation(false);
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- }
}
}
} else if (event->message_type == ATOM(_NET_WM_STATE)) {
@@ -2660,8 +2339,6 @@ void MCompositeManagerPrivate::clientMes
i->iconify(i->propertyCache()->iconGeometry(), needComp);
if (needComp)
enableCompositing(true);
- if (i->needDecoration())
- i->startTransition();
i->stopPing();
}
return;
@@ -2694,8 +2371,6 @@ void MCompositeManagerPrivate::closeHand
if ((!delete_sent || window->status() == MCompositeWindow::Hung)) {
kill_window(window->window());
- if (MDecoratorFrame::instance()->managedWindow() == window->window())
- MDecoratorFrame::instance()->hide();
}
/* DO NOT deleteLater() this window yet because
a) it can remove a mapped window from stacking_list
@@ -2710,13 +2385,6 @@ void MCompositeManagerPrivate::lowerHand
// TODO: (work for more)
// Handle minimize request coming from a managed window itself,
// if there are any
- FrameData fd = framed_windows.value(window->window());
- if (fd.frame) {
- setWindowState(fd.frame->managedWindow(), IconicState);
- MCompositeWindow *i = COMPOSITE_WINDOW(fd.frame->winId());
- if (i)
- i->iconify();
- }
if (window->isMapped()) {
// set for roughSort()
setWindowState(window->window(), IconicState);
@@ -2774,8 +2442,7 @@ void MCompositeManagerPrivate::activateW
MWindowPropertyCache *pc = cw->propertyCache();
if (pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_DESKTOP) &&
- pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_DOCK) &&
- !pc->isDecorator()) {
+ pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_DOCK)) {
if (!stacked) {
// if this is a transient window, raise the "parent" instead
Window last = getLastVisibleParent(pc);
@@ -2784,28 +2451,6 @@ void MCompositeManagerPrivate::activateW
// move it to the correct position in the stack
positionWindow(to_stack->window(), true);
}
- // possibly set decorator
- if (cw == getHighestDecorated() || cw->status() == MCompositeWindow::Hung) {
- if (FULLSCREEN_WINDOW(cw)) {
- // fullscreen window has decorator above it during ongoing call
- // and when it's jammed
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- if (cw->status() == MCompositeWindow::Hung)
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- else
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- } else if (cw->status() == MCompositeWindow::Hung) {
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- } else {
- MDecoratorFrame::instance()->setManagedWindow(cw);
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
- }
- }
- } else if (pc->isDecorator()) {
- // if decorator crashes and reappears, stack it to bottom, raise later
- if (!stacked)
- positionWindow(w, false);
} else if (w == stack[DESKTOP_LAYER]) {
if (!stacked)
positionWindow(w, true);
@@ -2815,7 +2460,7 @@ void MCompositeManagerPrivate::activateW
/* do this after possibly reordering the window stack */
if (disableCompositing)
dirtyStacking(false);
-}
+}
void MCompositeManagerPrivate::displayOff(bool display_off)
{
@@ -2852,24 +2497,12 @@ void MCompositeManagerPrivate::displayOf
void MCompositeManagerPrivate::callOngoing(bool ongoing_call)
{
+ // TODO: this method became a skeleton while the decorator was
+ // removed; figure out later on what we actually need to do in here
+ // or whether this is now unnecessary.
if (ongoing_call) {
- // if we have fullscreen app on top, set it decorated without resizing
- MCompositeWindow *cw = getHighestDecorated();
- if (cw && FULLSCREEN_WINDOW(cw)) {
- cw->setDecorated(true);
- MDecoratorFrame::instance()->setManagedWindow(cw, true);
- MDecoratorFrame::instance()->setOnlyStatusbar(true);
- }
dirtyStacking(false);
} else {
- // remove decoration from fullscreen windows
- for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
- it != windows.end(); ++it) {
- MCompositeWindow *i = it.value();
- if (FULLSCREEN_WINDOW(i) && i->needDecoration())
- i->setDecorated(false);
- }
- MDecoratorFrame::instance()->setOnlyStatusbar(false);
dirtyStacking(false);
}
}
@@ -3015,9 +2648,8 @@ bool MCompositeManagerPrivate::x11EventF
Window new_parent = ((XReparentEvent*)event)->parent;
MWindowPropertyCache *pc = prop_caches.value(window);
if (new_parent != pc->parentWindow()) {
- if (new_parent != QX11Info::appRootWindow() &&
- !framed_windows.contains(window)) {
- // if new parent is not root/frame, forget about the window
+ if (new_parent != QX11Info::appRootWindow()) {
+ // if new parent is not root, forget about the window
if (!pc->isInputOnly()
&& pc->parentWindow() != QX11Info::appRootWindow())
XRemoveFromSaveSet(QX11Info::display(), window);
@@ -3205,41 +2837,7 @@ void MCompositeManagerPrivate::removeWin
if (removed > 0) updateWinList();
}
-// Determine whether a decorator should be ordered above or below @win.
-// If the answer is definite it is stored in *@cmpp and NULL is returned.
-// Otherwise the decorator should be ordered exatly like the returned window,
-// the decorator's managed window.
-//
-// Unused decorators should be below anything else.
-// The decorated window should be below the decorator.
-// Otherwise we don't know.
-static bool compareDecorator(MWindowPropertyCache *win)
-{
- MDecoratorFrame *deco;
- MCompositeWindow *man;
- const QList<Window> &stack =
- static_cast<MCompositeManager*>(qApp)->stackingList();
-
- if (!(deco = MDecoratorFrame::instance()))
- // the decorator is so unused that we don't even know about it
- return true;
- if (!(man = deco->managedClient()))
- // the decorator is unused
- return true;
- if (man->propertyCache() == win)
- // @win is the decorator's managed window, keep them together
- return false;
- if (compareWindows(man->window(), win->winId()))
- return true;
- if (compareWindows(win->winId(), man->window()))
- return false;
- if (stack.indexOf(man->window()) < stack.indexOf(win->winId()))
- return true;
- else
- return false;
-}
-
-// Returns whether @pc in @layer of @type is special with regards to stacking.
+// Returns whether @cw in @layer of @type is special with regards to stacking.
// Returns None for non-special cases, or NOTIFICATION, INPUT or DIALOG.
// The returned Atom doesn't mean that @pc has that window type; it merely
// indicates that it should be stacked like that.
@@ -3302,16 +2900,6 @@ static bool compareWindows(Window w_a, W
if (!pc_a || !pc_b)
SORTING(false);
- // Mind decorators. Lone decorators should go below everything else,
- // otherwise it's sorted above its managed window.
- if (pc_a->isDecorator())
- // @pc_a is a lone decorator or @pc_b happens to be
- // its managed window.
- SORTING( compareDecorator(pc_b));
- else if (pc_b->isDecorator())
- // Likewise.
- SORTING(!compareDecorator(pc_a));
-
// Iconic/withdrawn/unmanaged windows...
if (pc_a->windowState() != NormalState) {
if (pc_b->windowState() == NormalState)
@@ -3456,14 +3044,10 @@ MCompositeWindow *MCompositeManagerPriva
int yres = ScreenOfDisplay(display, DefaultScreen(display))->height;
pc->setRequestedGeometry(QRect(0, 0, xres, yres));
}
-
- if (!pc->isDecorator() && !pc->isOverrideRedirect()
+ if (!pc->isOverrideRedirect()
&& windows_as_mapped.indexOf(window) == -1)
windows_as_mapped.append(window);
-
- if (needDecoration(window, pc))
- item->setDecorated(true);
-
+
item->updateWindowPixmap();
int i = stacking_list.indexOf(window);
@@ -3487,13 +3071,7 @@ MCompositeWindow *MCompositeManagerPriva
dirtyStacking(false);
return item;
}
-
- // the decorator got mapped. this is here because the compositor
- // could be restarted at any point
- if (pc->isDecorator() && !MDecoratorFrame::instance()->decoratorItem()) {
- // texture was already updated above
- MDecoratorFrame::instance()->setDecoratorItem(item);
- } else if (!device_state->displayOff())
+ if (!device_state->displayOff())
item->setVisible(true);
dirtyStacking(false);
@@ -3597,16 +3175,6 @@ void MCompositeManager::positionWindow(W
d->positionWindow(w, pos == MCompositeManager::STACK_TOP ? true : false);
}
-MCompositeWindow *MCompositeManager::decoratorWindow() const
-{
- return MDecoratorFrame::instance()->decoratorItem();
-}
-
-const QRect &MCompositeManager::availableRect() const
-{
- return MDecoratorFrame::instance()->availableRect();
-}
-
const QList<Window> &MCompositeManager::stackingList() const
{
return d->stacking_list;
@@ -3694,15 +3262,16 @@ void MCompositeManagerPrivate::disableCo
if (!compositing && forced == NO_FORCED)
return;
+ // TODO: Are there any cases where the next situation would be valid,
+ // now that the decorator is gone?
+ //
// we could still have existing decorator on-screen.
// ensure we don't accidentally disturb it
for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
it != windows.end(); ++it) {
MCompositeWindow *i = it.value();
- if (i->propertyCache()->isDecorator())
- continue;
- if (i->windowVisible() && (i->propertyCache()->hasAlpha()
- || i->needDecoration()))
+
+ if (i->windowVisible() && (i->propertyCache()->hasAlpha()))
return;
}
@@ -3713,8 +3282,8 @@ void MCompositeManagerPrivate::disableCo
for (QHash<Window, MCompositeWindow *>::iterator it = windows.begin();
it != windows.end(); ++it) {
MCompositeWindow *tp = it.value();
- // checks above fail. somehow decorator got in. stop it at this point
- if (!tp->propertyCache()->isDecorator() && !tp->isIconified()
+
+ if (!tp->isIconified()
&& !tp->propertyCache()->hasAlpha())
((MTexturePixmapItem *)tp)->enableDirectFbRendering();
setWindowDebugProperties(it.key());
@@ -3724,35 +3293,14 @@ void MCompositeManagerPrivate::disableCo
showOverlayWindow(false);
#endif
- if (MDecoratorFrame::instance()->decoratorItem())
- MDecoratorFrame::instance()->hide();
-
compositing = false;
}
void MCompositeManagerPrivate::gotHungWindow(MCompositeWindow *w, bool is_hung)
{
- MDecoratorFrame *deco = MDecoratorFrame::instance();
- if (!mayShowApplicationHungDialog || !deco->decoratorItem())
- return;
- if (!is_hung) {
- deco->showQueryDialog(false);
- return;
- }
-
- // own the window so we could kill it if we want to.
- enableCompositing(true);
- deco->setManagedWindow(w, true);
- deco->setOnlyStatusbar(false);
- deco->setAutoRotation(true);
- deco->showQueryDialog(true);
- dirtyStacking(false);
- deco->show();
-
- // We need to activate the window as well with instructions to decorate
- // the hung window. Above call just seems to mark the window as needing
- // decoration
- activateWindow(w->window(), CurrentTime, false);
+ // TODO: After the removal of the decorator, this function is a
+ // skeleton; figure out later on what we need to actually have in
+ // here.
}
void MCompositeManagerPrivate::exposeSwitcher()
@@ -3858,10 +3406,6 @@ void MCompositeManager::dumpState(const
qDebug( "current_app: 0x%lx", d->current_app);
qDebug( "topmostApp: 0x%lx (index: %d)",
d->getTopmostApp(&i), i);
- if ((cw = d->getHighestDecorated()) != NULL)
- qDebug("highestDecorated: 0x%lx", cw->window());
- else
- qDebug("highestDecorated: None");
qDebug( "local_win: 0x%lx, parent: 0x%lx",
d->localwin, d->localwin_parent);
@@ -3870,8 +3414,6 @@ void MCompositeManager::dumpState(const
qDebug( "buttoned_win: 0x%lx", d->buttoned_win);
// Decoration button geometries.
- qDebug( "decorated window: 0x%lx",
- MDecoratorFrame::instance()->managedWindow());
r = &d->home_button_geom;
qDebug( "home button: 0x%lx (%dx%d%+d%+d)",
d->home_button_win,
@@ -3914,7 +3456,7 @@ void MCompositeManager::dumpState(const
static const char *wintypes[] = {
"INVALID", "DESKTOP", "NORMAL", "DIALOG", "NO_DECOR_DIALOG",
"FRAMELESS", "DOCK", "INPUT", "ABOVE", "NOTIFICATION",
- "DECORATOR", "UNKNOWN",
+ "UNKNOWN",
};
static const char *winstates[] = {
"Withdrawn", "Normal", NULL, "Iconic"
@@ -3969,9 +3511,9 @@ void MCompositeManager::dumpState(const
yn[cw->propertyCache()->isInputOnly()]);
qDebug(" visible: %s, direct rendered: %s",
yn[cw->windowVisible()], yn[cw->isDirectRendered()]);
- qDebug(" window type: %s, is app: %s, needs decoration: %s",
+ qDebug(" window type: %s, is app: %s",
wintypes[cw->propertyCache()->windowType()],
- yn[cw->isAppWindow()], yn[cw->needDecoration()]);
+ yn[cw->isAppWindow()]);
qDebug(" status: %s, state: %s", appstates[cw->status()],
winstate < (int)(sizeof(winstates)/sizeof(winstates[0]))
? winstates[winstate] : NULL);
@@ -3998,17 +3540,6 @@ void MCompositeManager::dumpState(const
XFree(name);
}
- if (!d->framed_windows.isEmpty()) {
- QHash<Window, MCompositeManagerPrivate::FrameData>::const_iterator fwit;
-
- qDebug("framed_windows:");
- for (fwit = d->framed_windows.constBegin();
- fwit != d->framed_windows.constEnd(); ++fwit)
- qDebug(" 0x%lx: parent=0x%lx, mapped=%s", fwit.key(),
- fwit->parentWindow, fwit->mapped ? "yes" : "no");
- } else
- qDebug("framed_windows: <None>");
-
// Which windows are in the property cache?
line = "with property cache:";
QHash<Window, MWindowPropertyCache*>::const_iterator pcit;
@@ -4277,8 +3808,6 @@ MCompositeManager::MCompositeManager(int
: QApplication(argc, argv)
{
d = new MCompositeManagerPrivate(this);
- MRmiServer *s = new MRmiServer(".mcompositor", this);
- s->exportObject(this);
d->mayShowApplicationHungDialog = !arguments().contains("-nohung");
--- a/src/mcompositemanager.h
+++ b/src/mcompositemanager.h
@@ -171,6 +171,10 @@ public slots:
// called with the answer to mdecorator's dialog
void queryDialogAnswer(unsigned int window, bool yes_answer);
+ /* TODO: check whether the following method(s) are actually invoked
+ * by anything. At least the now-removed decorator didn't invoke them.
+ */
+
/*! Invoked remotely by MRmiClient to show a launch indicator
*
* \param timeout seconds elapsed to hide the launch indicator in case
@@ -184,22 +188,9 @@ public slots:
*/
void exposeSwitcher();
- /*!
- * Returns the decorator window or NULL.
- */
- MCompositeWindow *decoratorWindow() const;
-
- /*!
- * Area that is free after the area that decorator occupies.
- */
- const QRect &availableRect() const;
-
#ifdef WINDOW_DEBUG
void remoteControl(int fd);
#endif
-
-signals:
- void decoratorRectChanged(const QRect& rect);
private:
MCompositeManagerPrivate *d;
--- a/src/mcompositemanager_p.h
+++ b/src/mcompositemanager_p.h
@@ -117,10 +117,8 @@ public:
bool x11EventFilter(XEvent *event);
bool processX11EventFilters(XEvent *event, bool after);
void removeWindow(Window w);
- bool needDecoration(Window w, MWindowPropertyCache *pc = 0);
bool skipStartupAnim(MWindowPropertyCache *pc);
- MCompositeWindow *getHighestDecorated(int *index = 0);
-
+
void roughSort();
void setCurrentApp(Window w, bool stacking_order_changed);
bool raiseWithTransients(MWindowPropertyCache *pc,
@@ -142,13 +140,7 @@ public:
QList<Window> windows_as_mapped;
QHash<Window, MCompositeWindow *> windows;
- struct FrameData {
- FrameData(): frame(0), parentWindow(0), mapped(false) {}
- MSimpleWindowFrame *frame;
- Window parentWindow;
- bool mapped;
- };
- QHash<Window, FrameData> framed_windows;
+
QHash<Window, QList<XConfigureRequestEvent> > configure_reqs;
QHash<Window, MWindowPropertyCache*> prop_caches;
QMultiHash<int, MCompositeManagerExtension* > m_extensions;
--- a/src/mcompositescene.cpp
+++ b/src/mcompositescene.cpp
@@ -96,14 +96,7 @@ void MCompositeScene::drawItems(QPainter
if (cw->type() != item_type) {
if (!cw->propertyCache()) // this window is dead
continue;
- if (cw->hasTransitioningWindow() && cw->propertyCache()->isDecorator())
- // if we have a transition animation, don't draw the decorator
- // lest we can have it drawn with the transition (especially
- // when desktop window is not yet shown, NB#192454)
- continue;
- if (cw->group())
- // items that belong to a group are drawn by the group
- continue;
+
if (cw->isDirectRendered() || !cw->isVisible()
|| !(cw->propertyCache()->isMapped() || cw->isWindowTransitioning())
|| cw->propertyCache()->isInputOnly())
@@ -152,12 +145,6 @@ void MCompositeScene::drawItems(QPainter
glClear(GL_COLOR_BUFFER_BIT);
}
desktop_painted = true;
- if (cw->propertyCache()->isDecorator()) {
- // don't paint decorator on top of plain black background
- // (see NB#182860, NB#192454)
- painter->restore();
- continue;
- }
}
// TODO: paint only the intersected region (glScissor?)
painter->setMatrix(cw->sceneMatrix(), true);
--- a/src/mcompositewindow.cpp
+++ b/src/mcompositewindow.cpp
@@ -22,7 +22,6 @@
#include "mcompositemanager.h"
#include "mcompositemanager_p.h"
#include "mtexturepixmapitem.h"
-#include "mdecoratorframe.h"
#include "mcompositemanagerextension.h"
#include "mcompositewindowgroup.h"
@@ -52,7 +51,6 @@ MCompositeWindow::MCompositeWindow(Qt::H
iconify_state(NoIconifyState),
destroyed(false),
window_status(Normal),
- need_decor(false),
window_obscured(-1),
is_transitioning(false),
dimmed_effect(false),
@@ -622,15 +620,6 @@ MCompositeWindow::WindowStatus MComposit
return window_status;
}
-bool MCompositeWindow::needDecoration() const
-{
- return need_decor;
-}
-
-void MCompositeWindow::setDecorated(bool decorated)
-{
- need_decor = decorated;
-}
MCompositeWindow *MCompositeWindow::compositeWindow(Qt::HANDLE window)
{
@@ -702,11 +691,8 @@ void MCompositeWindow::findBehindWindow(
if (behind_i >= 0 && behind_i < p->d->stacking_list.size()) {
MCompositeWindow* w = MCompositeWindow::compositeWindow(p->d->stacking_list.at(behind_i));
if (w->propertyCache()->windowState() == NormalState
- && w->propertyCache()->isMapped()
- && !w->propertyCache()->isDecorator())
+ && w->propertyCache()->isMapped())
behind_window = w;
- else if (w->propertyCache()->isDecorator() && MDecoratorFrame::instance()->managedClient())
- behind_window = MDecoratorFrame::instance()->managedClient();
else
behind_window = MCompositeWindow::compositeWindow(p->d->stack[DESKTOP_LAYER]);
}
@@ -735,8 +721,7 @@ bool MCompositeWindow::isAppWindow(bool
pc->windowTypeAtom() == ATOM(_KDE_NET_WM_WINDOW_TYPE_OVERRIDE) ||
/* non-modal, non-transient dialogs behave like applications */
(pc->windowTypeAtom() == ATOM(_NET_WM_WINDOW_TYPE_DIALOG) &&
- (pc->netWmState().indexOf(ATOM(_NET_WM_STATE_MODAL)) == -1)))
- && !pc->isDecorator())
+ (pc->netWmState().indexOf(ATOM(_NET_WM_STATE_MODAL)) == -1))))
return true;
return false;
}
--- a/src/mcompositewindow.h
+++ b/src/mcompositewindow.h
@@ -185,15 +185,6 @@ public:
*/
void setIconifyState(IconifyState state);
- /*!
- * Returns true if this window needs a decoration
- */
- bool needDecoration() const;
-
- /*!
- * Sets whether this window is decorated or not
- */
- void setDecorated(bool decorated);
void setIsMapped(bool mapped);
bool isMapped() const;
@@ -410,7 +401,6 @@ private:
IconifyState iconify_state;
bool destroyed;
WindowStatus window_status;
- bool need_decor;
bool window_visible;
short window_obscured;
bool is_valid;
--- a/src/mdecoratorframe.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/***************************************************************************
-**
-** 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 "mdecoratorframe.h"
-#include "mcompositewindow.h"
-#include "mtexturepixmapitem.h"
-#include "mcompositemanager.h"
-#include "mcompositordebug.h"
-
-#include <mrmiclient.h>
-#include <QX11Info>
-
-#include <X11/Xutil.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#include <X11/Xmd.h>
-
-MDecoratorFrame *MDecoratorFrame::d = 0;
-
-MDecoratorFrame *MDecoratorFrame::instance()
-{
- if (!d)
- d = new MDecoratorFrame();
- return d;
-}
-
-MDecoratorFrame::MDecoratorFrame(QObject *p)
- : QObject(p),
- client(0),
- decorator_window(0),
- decorator_item(0),
- no_resize(false)
-{
- MCompositeManager *mgr = (MCompositeManager *) qApp;
- connect(mgr, SIGNAL(decoratorRectChanged(const QRect&)), this,
- SLOT(setDecoratorAvailableRect(const QRect&)));
- /*!
- * Excute decorator process here.
- */
-
- remote_decorator = new MRmiClient(".mabstractdecorator", this);
-}
-
-Qt::HANDLE MDecoratorFrame::managedWindow() const
-{
- return client ? client->window() : 0;
-}
-
-Qt::HANDLE MDecoratorFrame::winId() const
-{
- return decorator_window;
-}
-
-void MDecoratorFrame::hide()
-{
- if (decorator_item)
- decorator_item->setVisible(false);
-}
-
-void MDecoratorFrame::show()
-{
- if (decorator_item)
- decorator_item->setVisible(true);
-}
-
-void MDecoratorFrame::sendManagedWindowId()
-{
- qulonglong winid = client ? client->window() : 0;
- if(client)
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteSetClientGeometry",
- client->propertyCache()->requestedGeometry());
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteSetAutoRotation", false);
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteSetManagedWinId", winid);
-}
-
-void MDecoratorFrame::setManagedWindow(MCompositeWindow *cw, bool no_resize)
-{
- this->no_resize = no_resize;
-
- if (client == cw)
- return;
- if (client)
- disconnect(client, SIGNAL(destroyed()), this, SLOT(destroyClient()));
- client = cw;
-
- if (!decorator_item)
- return;
- sendManagedWindowId();
- if (cw)
- connect(cw, SIGNAL(destroyed()), SLOT(destroyClient()));
-}
-
-void MDecoratorFrame::setDecoratorWindow(Qt::HANDLE window)
-{
- decorator_window = window;
- XMapWindow(QX11Info::display(), window);
-}
-
-void MDecoratorFrame::setDecoratorItem(MCompositeWindow *window)
-{
- decorator_item = window;
- connect(decorator_item, SIGNAL(destroyed()), SLOT(destroyDecorator()));
-
- MTexturePixmapItem *item = (MTexturePixmapItem *) window;
- if (!decorator_window)
- setDecoratorWindow(item->window());
- sendManagedWindowId();
-}
-
-MCompositeWindow *MDecoratorFrame::decoratorItem() const
-{
- return decorator_item;
-}
-
-void MDecoratorFrame::destroyDecorator()
-{
- setDecoratorAvailableRect(QRect());
- decorator_item = 0;
- decorator_window = 0;
-}
-
-void MDecoratorFrame::destroyClient()
-{
- if (client == sender())
- client = 0;
-}
-
-void MDecoratorFrame::visualizeDecorator(bool visible)
-{
- if (sender() == decorator_item)
- return;
-
- if (decorator_item)
- decorator_item->setVisible(visible);
-}
-
-void MDecoratorFrame::setDecoratorAvailableRect(const QRect& r)
-{
- // always store the available rect info from remote decorator
- available_rect = r;
-
- if (!client || no_resize || !decorator_item
- || !decorator_item->propertyCache())
- return;
-
- Display* dpy = QX11Info::display();
-
- if (client->propertyCache()->realGeometry() != available_rect) {
- // resize app window to occupy the free area
- XMoveResizeWindow(dpy, client->window(), r.x(), r.y(), r.width(), r.height());
- MOVE_RESIZE(client->window(), r.x(), r.y(), r.width(), r.height());
- }
-}
-
-void MDecoratorFrame::setAutoRotation(bool mode)
-{
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteSetAutoRotation", mode);
-}
-
-void MDecoratorFrame::setOnlyStatusbar(bool mode)
-{
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteSetOnlyStatusbar", mode);
-}
-
-void MDecoratorFrame::showQueryDialog(bool visible)
-{
- remote_decorator->invoke("MAbstractDecorator",
- "RemoteShowQueryDialog", visible);
-}
--- a/src/mdecoratorframe.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/***************************************************************************
-**
-** 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.
-**
-****************************************************************************/
-
-#ifndef DUIDECORATORFRAME_H
-#define DUIDECORATORFRAME_H
-
-#include <QObject>
-#include <QRect>
-
-class MCompositeWindow;
-class MRmiClient;
-class QRect;
-
-/*!
- * MDecoratorFrame is a singleton class that represents the decorator process
- * which draws the decorations for non-DirectUI applications.
- * This class handles the communication as well to the decorator.
- */
-class MDecoratorFrame: public QObject
-{
- Q_OBJECT
-public:
-
- /*!
- * Singleton accessor
- */
- static MDecoratorFrame *instance();
-
- /*!
- * Retuns the window id of the managed window.
- */
- Qt::HANDLE managedWindow() const;
- MCompositeWindow *managedClient() const { return client; }
-
- /*!
- * Returns the window id of the decorator window.
- */
- Qt::HANDLE winId() const;
-
- /*!
- * Hides the decorator QGraphicsItem.
- */
- void hide();
-
- /*!
- * Shows the decorator QGraphicsItem.
- */
- void show();
-
- /*!
- * Sets the managed window.
- */
- void setManagedWindow(MCompositeWindow *cw, bool no_resize = false);
-
- /*!
- * Sets the automatic rotation mode.
- */
- void setAutoRotation(bool mode);
-
- /*!
- * Sets the "only statusbar" mode.
- */
- void setOnlyStatusbar(bool mode);
-
- /*!
- * Show/hide the query dialog.
- */
- void showQueryDialog(bool visible);
-
- /*!
- * Sets the decorator window and maps that window if it is unmapped.
- */
- void setDecoratorWindow(Qt::HANDLE window);
-
- void setDecoratorItem(MCompositeWindow *window);
-
- MCompositeWindow *decoratorItem() const;
- const QRect &availableRect() const { return available_rect; }
-
-public slots:
- void setDecoratorAvailableRect(const QRect& r);
-
-private slots:
- void destroyDecorator();
- void destroyClient();
- void visualizeDecorator(bool visible);
-
-private:
- explicit MDecoratorFrame(QObject *object = 0);
- void sendManagedWindowId();
- static MDecoratorFrame *d;
-
- MCompositeWindow *client;
- Qt::HANDLE decorator_window;
- MCompositeWindow *decorator_item;
- MRmiClient *remote_decorator;
- int top_offset;
- bool no_resize;
- QRect available_rect;
-};
-
-#endif // DUIDECORATORFRAME_H
--- a/src/mwindowpropertycache.cpp
+++ b/src/mwindowpropertycache.cpp
@@ -114,7 +114,6 @@ void MWindowPropertyCache::init()
has_alpha = -1;
global_alpha = 255;
video_global_alpha = -1;
- is_decorator = false;
wmhints = XAllocWMHints();
attrs = 0;
meego_layer = 0;
@@ -176,9 +175,6 @@ MWindowPropertyCache::MWindowPropertyCac
} else
addRequest(SLOT(realGeometry()),
xcb_get_geometry(xcb_conn, window).sequence);
- addRequest(SLOT(isDecorator()),
- requestProperty(MCompAtoms::_MEEGOTOUCH_DECORATOR_WINDOW,
- XCB_ATOM_CARDINAL));
addRequest(SLOT(transientFor()),
requestProperty(XCB_ATOM_WM_TRANSIENT_FOR,
XCB_ATOM_WINDOW));
@@ -500,24 +496,6 @@ void MWindowPropertyCache::desktopView(b
XCB_ATOM_CARDINAL));
}
-bool MWindowPropertyCache::isDecorator()
-{
- QLatin1String me(SLOT(isDecorator()));
- if (is_valid && requests[me]) {
- xcb_get_property_cookie_t c = { requests[me] };
- xcb_get_property_reply_t *r;
- r = xcb_get_property_reply(xcb_conn, c, 0);
- replyCollected(me);
- is_decorator = false;
- if (r) {
- if (xcb_get_property_value_length(r) == sizeof(CARD32))
- is_decorator = *((CARD32*)xcb_get_property_value(r));
- free(r);
- }
- }
- return is_decorator;
-}
-
unsigned int MWindowPropertyCache::meegoStackingLayer()
{
QLatin1String me(SLOT(meegoStackingLayer()));
--- a/src/mwindowpropertycache.h
+++ b/src/mwindowpropertycache.h
@@ -136,7 +136,6 @@ public:
const QRect &closeButtonGeometry();
public slots:
- bool isDecorator();
Atom windowTypeAtom();
const XWMHints &getWMHints();
@@ -235,7 +234,6 @@ private:
signed char has_alpha;
int global_alpha;
int video_global_alpha;
- bool is_decorator;
QList<Atom> net_wm_state;
// geometry is requested only once in the beginning, after that, we
// use ConfigureNotifys to update the size through setRealGeometry()
--- a/src/src.pro
+++ b/src/src.pro
@@ -26,7 +26,7 @@ DEPENDPATH += .
QT += dbus
# Input
-INCLUDEPATH += ../decorators/libdecorator/
+#INCLUDEPATH += ../decorators/libdecorator/
HEADERS += \
mtexturepixmapitem.h \
mtexturepixmapitem_p.h \
@@ -35,11 +35,9 @@ HEADERS += \
mwindowpropertycache.h \
mcompwindowanimator.h \
mcompositemanager.h \
- msimplewindowframe.h \
mcompositemanager_p.h \
mdevicestate.h \
mcompatoms_p.h \
- mdecoratorframe.h \
mcompositemanagerextension.h \
mcompositewindowshadereffect.h \
mcompmgrextensionfactory.h
@@ -51,9 +49,7 @@ SOURCES += \
mwindowpropertycache.cpp \
mcompwindowanimator.cpp \
mcompositemanager.cpp \
- msimplewindowframe.cpp \
mdevicestate.cpp \
- mdecoratorframe.cpp \
mcompositemanagerextension.cpp \
mcompositewindowshadereffect.cpp
@@ -78,7 +74,7 @@ target.path += /usr/lib
INSTALLS += target
LIBS += -lXdamage -lXcomposite -lXfixes -lX11-xcb -lxcb-render -lxcb-shape \
- -lXrandr ../decorators/libdecorator/libdecorator.so
+ -lXrandr
QMAKE_EXTRA_TARGETS += check
check.depends = $$TARGET
--- a/tests/appinterface/appinterface.pro
+++ /dev/null
@@ -1,14 +0,0 @@
-######################################################################
-# Automatically generated by qmake (2.01a) Wed Dec 15 10:41:38 2010
-######################################################################
-
-TEMPLATE = app
-TARGET =
-DEPENDPATH += .
-INCLUDEPATH += . ../../decorators/libdecorator
-QMAKE_LFLAGS += -L../../decorators/libdecorator #to link to the library of the repo not of the system
-LIBS += -ldecorator
-QT += dbus
-
-# Input
-SOURCES += main.cpp
--- a/tests/appinterface/main.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-#include <QtGui>
-#include <QDBusConnection>
-#include <mdecorator_dbus_interface.h>
-
-class MainWindow : public QMainWindow
-{
- Q_OBJECT
-
-public:
- MainWindow(QWidget* parent = NULL)
- : QMainWindow(parent)
- , menuActionCounter(0)
- , toolBarActionCounter(0)
- , addMenuAction(new QPushButton("add Menu Action"))
- , addToolBarAction(new QPushButton("add ToolBar Action"))
- , removeMenuAction(new QPushButton("remove Menu Action"))
- , removeToolBarAction(new QPushButton("remove ToolBar Action"))
- , interface(new MDecoratorInterface("com.nokia.MDecorator", "/MDecorator", QDBusConnection::sessionBus(),this))
- , isStyled(false)
- {
- setCentralWidget(new QWidget());
-
- QGridLayout* grid = new QGridLayout(centralWidget());
- grid->addWidget(addMenuAction,0,0);
- grid->addWidget(removeMenuAction,0,1);
- grid->addWidget(addToolBarAction,1,0);
- grid->addWidget(removeToolBarAction,1,1);
-
- connect(addMenuAction,SIGNAL(clicked()),SLOT(onAddMenuAction()));
- connect(addToolBarAction,SIGNAL(clicked()),SLOT(onAddToolBarAction()));
- connect(removeMenuAction,SIGNAL(clicked()),SLOT(onRemoveMenuAction()));
- connect(removeToolBarAction,SIGNAL(clicked()),SLOT(onRemoveToolBarAction()));
-
- toolBar = addToolBar("ToolBar");
-
- if(style()->inherits("QtMaemo6Style")) {
- isStyled = true;
- } else {
- qDBusRegisterMetaType<MDecoratorIPCAction>();
- qDBusRegisterMetaType<MDecoratorIPCActionList>();
- connect(interface, SIGNAL(triggered(QString,bool)), SLOT(onTriggeredDBus(QString,bool)));
- connect(interface, SIGNAL(toggled(QString,bool)), SLOT(onToggledDBus(QString,bool)));
- }
- }
-
-public slots:
-
- void onAddMenuAction()
- {
- QAction* act = new QAction("MenuAction " +QString::number(menuActionCounter++),menuBar());
- act->setObjectName(act->text());
- connect(act,SIGNAL(triggered(bool)),SLOT(onTriggered(bool)));
- connect(act,SIGNAL(toggled(bool)),SLOT(onToggled(bool)));
- menuBar()->addAction(act);
- if (!isStyled)
- updateDecorator();
- }
-
- void onAddToolBarAction()
- {
- QAction* act = new QAction("ToolBarAction " +QString::number(toolBarActionCounter++),toolBar);
- act->setObjectName(act->text());
- act->setIcon(QIcon("/usr/share/themes/blanco/meegotouch/icons/icon-m-content-videos.png"));
- QIcon icon("/usr/share/themes/blanco/meegotouch/icons/icon-m-content-videos.png");
-
- connect(act,SIGNAL(triggered(bool)),SLOT(onTriggered(bool)));
- connect(act,SIGNAL(toggled(bool)),SLOT(onToggled(bool)));
- toolBar->addAction(act);
- if (!isStyled)
- updateDecorator();
- }
-
- void onRemoveMenuAction()
- {
- if (!menuBar()->actions().isEmpty()) {
- QAction* act = menuBar()->actions().last();
- menuBar()->removeAction(act);
- delete act;
- menuActionCounter--;
- if (!isStyled)
- updateDecorator();
- }
- }
-
- void onRemoveToolBarAction()
- {
- if (!toolBar->actions().isEmpty()) {
- QAction* act = toolBar->actions().last();
- toolBar->removeAction(act);
- delete act;
- toolBarActionCounter--;
- if (!isStyled)
- updateDecorator();
- }
- }
-
- void updateDecorator()
- {
- QList<MDecoratorIPCAction> list;
- foreach(QAction*act ,menuBar()->actions())
- {
- MDecoratorIPCAction iact(*act, MDecoratorIPCAction::MenuAction);
- list.append(iact);
- }
- foreach(QAction*act ,toolBar->actions())
- {
- MDecoratorIPCAction iact(*act, MDecoratorIPCAction::ToolBarAction);
- list.append(iact);
- }
- interface->setActions(list, winId());
- }
-
- void onTriggeredDBus(const QString& uuid, bool b)
- {
- qCritical()<<"Action with UUID"<<uuid<<"triggered. value:"<<b;
- }
-
- void onToggledDBus(const QString& uuid, bool b)
- {
- qCritical()<<"Action with UUID"<<uuid<<"toggled. value:"<<b;
- }
-
- void onTriggered(bool val)
- {
- if(!sender())
- return;
- qCritical()<<sender()<<"triggered with value:"<<val;
- }
-
- void onToggled(bool val)
- {
- if(!sender())
- return;
- qCritical()<<sender()<<"toggled with value:"<<val;
- }
-
-private:
- int menuActionCounter;
- int toolBarActionCounter;
- QPushButton* addMenuAction;
- QPushButton* addToolBarAction;
- QPushButton* removeMenuAction;
- QPushButton* removeToolBarAction;
- QToolBar* toolBar;
- MDecoratorInterface* interface;
- bool isStyled;
-};
-
-int main (int argc, char** argv)
-{
- QApplication app(argc, argv);
-
- MainWindow m;
- m.show();
-
- return app.exec();
-}
-
-#include "main.moc"
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -3,5 +3,4 @@ TEMPLATE=subdirs
SUBDIRS = windowctl \
windowstack \
focus-tracker \
- functional \
- appinterface
+ functional
--- a/translations/recovery.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
- <name></name>
- <message id="qtn_reco_app_not_responding">
- <location filename="../decorators/mdecorator/mdecoratorwindow.cpp" line="454"/>
- <source></source>
- <translation>%1 sucks</translation>
- </message>
- <message id="qtn_reco_close_app_question">
- <location filename="../decorators/mdecorator/mdecoratorwindow.cpp" line="461"/>
- <source></source>
- <translation>Do you want to close it?</translation>
- </message>
- <message id="qtn_comm_command_yes">
- <location filename="../decorators/mdecorator/mdecoratorwindow.cpp" line="469"/>
- <source></source>
- <translation>Aje</translation>
- </message>
- <message id="qtn_comm_command_no">
- <location filename="../decorators/mdecorator/mdecoratorwindow.cpp" line="471"/>
- <source></source>
- <translation>Oh, no!</translation>
- </message>
-</context>
-</TS>
--- a/translations/translations.pro
+++ b/translations/translations.pro
@@ -1,13 +1,13 @@
LANGUAGES = # empty, means to build only engineering English
SOURCEDIR = $$PWD/..
-CATALOGNAME = recovery
+CATALOGNAME = # empty, as we do not currently have a catalog
TRANSLATIONDIR = $$PWD
TRANSLATION_INSTALLDIR = $$M_TRANSLATION_DIR
include($$[QT_INSTALL_DATA]/mkspecs/features/meegotouch_defines.prf)
include($$[QT_INSTALL_DATA]/mkspecs/features/meegotouch_translations.prf)
# Only depend on $$FILES, and do not regenerate recovery.ts all the times.
-FILES = $$SOURCEDIR/decorators/mdecorator/mdecoratorwindow.cpp
+FILES = # empty, as we do not currently have any files using this
updateeets.input = FILES
updateeets.clean = nothing
QMAKE_EXTRA_COMPILERS -= dummy