2007-11-29 14:11:02 +00:00
|
|
|
/*
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
copy of this software and associated documentation files (the "Software"),
|
|
|
|
to deal in the Software without restriction, including without limitation
|
|
|
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "kcommondecoration_p.h"
|
|
|
|
|
|
|
|
#include "kcommondecoration.h"
|
2008-10-17 10:30:43 +00:00
|
|
|
#include "kdecorationbridge.h"
|
|
|
|
|
|
|
|
#include <assert.h>
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
#include "kcommondecoration_p.moc"
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
KCommonDecorationWrapper::KCommonDecorationWrapper(KCommonDecoration* deco, KDecorationBridge* bridge, KDecorationFactory* factory)
|
|
|
|
: KDecorationUnstable(bridge, factory)
|
|
|
|
, decoration(deco)
|
|
|
|
{
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
KCommonDecorationWrapper::~KCommonDecorationWrapper()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
// the wrapper actually owns KCommonDecoration, since the wrapper is what KWin core uses
|
|
|
|
delete decoration;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::init()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->init();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
KCommonDecorationWrapper::Position KCommonDecorationWrapper::mousePosition(const QPoint& p) const
|
|
|
|
{
|
|
|
|
return decoration->mousePosition(p);
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void KCommonDecorationWrapper::borders(int& left, int& right, int& top, int& bottom) const
|
|
|
|
{
|
|
|
|
return decoration->borders(left, right, top, bottom);
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void KCommonDecorationWrapper::resize(const QSize& s)
|
|
|
|
{
|
|
|
|
return decoration->resize(s);
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
QSize KCommonDecorationWrapper::minimumSize() const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->minimumSize();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::activeChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->activeChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::captionChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->captionChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::iconChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->iconChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::maximizeChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->maximizeChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::desktopChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->desktopChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
|
|
|
void KCommonDecorationWrapper::shadeChange()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-11-29 14:11:02 +00:00
|
|
|
return decoration->shadeChange();
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
bool KCommonDecorationWrapper::drawbound(const QRect& geom, bool clear)
|
|
|
|
{
|
|
|
|
return decoration->drawbound(geom, clear);
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
bool KCommonDecorationWrapper::windowDocked(Position side)
|
|
|
|
{
|
|
|
|
return decoration->windowDocked(side);
|
|
|
|
}
|
2007-11-29 14:11:02 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void KCommonDecorationWrapper::reset(unsigned long changed)
|
|
|
|
{
|
|
|
|
return decoration->reset(changed);
|
|
|
|
}
|
2008-10-17 10:30:43 +00:00
|
|
|
|
2009-05-04 22:35:33 +00:00
|
|
|
void KCommonDecorationWrapper::padding(int &left, int &right, int &top, int &bottom) const
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2009-05-04 22:35:33 +00:00
|
|
|
left = decoration->layoutMetric(KCommonDecoration::LM_OuterPaddingLeft);
|
|
|
|
right = decoration->layoutMetric(KCommonDecoration::LM_OuterPaddingRight);
|
|
|
|
top = decoration->layoutMetric(KCommonDecoration::LM_OuterPaddingTop);
|
|
|
|
bottom = decoration->layoutMetric(KCommonDecoration::LM_OuterPaddingBottom);
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2009-05-04 22:35:33 +00:00
|
|
|
|
2012-10-12 09:34:05 +00:00
|
|
|
void KCommonDecorationWrapper::wrapSetAlphaEnabled(bool enabled)
|
|
|
|
{
|
|
|
|
setAlphaEnabled(enabled);
|
|
|
|
}
|
|
|
|
|
2012-11-07 12:38:11 +00:00
|
|
|
QRegion KCommonDecorationWrapper::region(KDecorationDefines::Region r)
|
|
|
|
{
|
|
|
|
QRegion region;
|
|
|
|
QMetaObject::invokeMethod(decoration, "region",
|
|
|
|
Qt::DirectConnection,
|
|
|
|
Q_RETURN_ARG(QRegion, region),
|
2012-11-24 09:14:45 +00:00
|
|
|
Q_ARG(KDecorationDefines::Region, r));
|
2012-11-07 12:38:11 +00:00
|
|
|
return region;
|
|
|
|
}
|