2009-06-19 09:18:07 +00:00
|
|
|
/********************************************************************
|
2010-04-12 19:28:58 +00:00
|
|
|
Copyright (C) 2009, 2010 Martin Gräßlin <kde@martin-graesslin.com>
|
2009-06-19 09:18:07 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#ifndef AURORAE_H
|
|
|
|
#define AURORAE_H
|
|
|
|
|
|
|
|
#include "themeconfig.h"
|
|
|
|
|
2010-04-12 19:28:58 +00:00
|
|
|
#include <kdecoration.h>
|
2009-06-19 09:18:07 +00:00
|
|
|
#include <kdecorationfactory.h>
|
|
|
|
|
2010-05-09 09:08:09 +00:00
|
|
|
class QGraphicsSceneMouseEvent;
|
2010-04-12 19:28:58 +00:00
|
|
|
class QGraphicsView;
|
|
|
|
class QGraphicsScene;
|
2009-06-19 09:18:07 +00:00
|
|
|
|
|
|
|
namespace Aurorae
|
|
|
|
{
|
2010-04-12 19:28:58 +00:00
|
|
|
class AuroraeTheme;
|
|
|
|
class AuroraeScene;
|
2009-06-19 09:18:07 +00:00
|
|
|
|
|
|
|
class AuroraeFactory : public QObject, public KDecorationFactoryUnstable
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~AuroraeFactory();
|
|
|
|
|
|
|
|
static AuroraeFactory* instance();
|
|
|
|
bool reset(unsigned long changed);
|
|
|
|
KDecoration *createDecoration(KDecorationBridge*);
|
|
|
|
bool supports(Ability ability) const;
|
2009-11-08 20:35:34 +00:00
|
|
|
virtual QList< BorderSize > borderSizes() const;
|
2009-06-19 09:18:07 +00:00
|
|
|
|
2010-04-12 19:28:58 +00:00
|
|
|
AuroraeTheme *theme() const {
|
|
|
|
return m_theme;
|
2010-01-01 12:47:48 +00:00
|
|
|
}
|
2009-06-19 09:18:07 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
AuroraeFactory();
|
|
|
|
void init();
|
|
|
|
|
|
|
|
private:
|
|
|
|
static AuroraeFactory *s_instance;
|
|
|
|
|
2010-04-12 19:28:58 +00:00
|
|
|
AuroraeTheme *m_theme;
|
2009-06-19 09:18:07 +00:00
|
|
|
};
|
|
|
|
|
2010-04-12 19:28:58 +00:00
|
|
|
class AuroraeClient : public KDecorationUnstable
|
2009-06-19 09:18:07 +00:00
|
|
|
{
|
2009-07-27 21:30:26 +00:00
|
|
|
Q_OBJECT
|
2009-06-19 09:18:07 +00:00
|
|
|
public:
|
2010-04-12 19:28:58 +00:00
|
|
|
AuroraeClient(KDecorationBridge* bridge, KDecorationFactory* factory);
|
2009-11-01 12:12:30 +00:00
|
|
|
virtual void activeChange();
|
2010-04-12 19:28:58 +00:00
|
|
|
virtual void borders(int& left, int& right, int& top, int& bottom) const;
|
2009-11-01 12:12:30 +00:00
|
|
|
virtual void captionChange();
|
2010-04-12 19:28:58 +00:00
|
|
|
virtual void desktopChange();
|
|
|
|
virtual void iconChange();
|
|
|
|
virtual void init();
|
|
|
|
virtual void maximizeChange();
|
|
|
|
virtual QSize minimumSize() const;
|
|
|
|
virtual Position mousePosition(const QPoint& p) const;
|
2009-11-01 12:12:30 +00:00
|
|
|
virtual void resize(const QSize& s);
|
2010-04-12 19:28:58 +00:00
|
|
|
virtual void shadeChange();
|
|
|
|
// optional overrides
|
|
|
|
virtual void padding(int &left, int &right, int &top, int &bottom) const;
|
|
|
|
virtual void reset(long unsigned int changed);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void menuClicked();
|
|
|
|
void toggleShade();
|
|
|
|
void keepAboveChanged(bool above);
|
|
|
|
void keepBelowChanged(bool below);
|
|
|
|
void toggleKeepAbove();
|
|
|
|
void toggleKeepBelow();
|
|
|
|
void titlePressed(Qt::MouseButton button, Qt::MouseButtons buttons);
|
|
|
|
void titleReleased(Qt::MouseButton button, Qt::MouseButtons buttons);
|
|
|
|
void titleMouseMoved(Qt::MouseButton button, Qt::MouseButtons buttons);
|
2010-05-09 09:08:09 +00:00
|
|
|
void tabMouseButtonPress(QGraphicsSceneMouseEvent *e, int index);
|
|
|
|
void tabMouseButtonRelease(QGraphicsSceneMouseEvent *e, int index);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual bool eventFilter(QObject *o, QEvent *e);
|
2009-07-27 21:30:26 +00:00
|
|
|
|
2009-11-01 12:12:30 +00:00
|
|
|
private:
|
2010-04-12 19:28:58 +00:00
|
|
|
void updateWindowShape();
|
2010-05-09 09:08:09 +00:00
|
|
|
void checkTabs(bool force = false);
|
2010-04-12 19:28:58 +00:00
|
|
|
AuroraeScene *m_scene;
|
|
|
|
QGraphicsView *m_view;
|
2010-05-09 09:08:09 +00:00
|
|
|
bool m_clickInProgress;
|
2009-06-19 09:18:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|