~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/libkdecorations/kdecorationfactory.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************
 
2
This file is part of the KDE project.
 
3
 
 
4
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
 
5
 
 
6
Permission is hereby granted, free of charge, to any person obtaining a
 
7
copy of this software and associated documentation files (the "Software"),
 
8
to deal in the Software without restriction, including without limitation
 
9
the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
10
and/or sell copies of the Software, and to permit persons to whom the
 
11
Software is furnished to do so, subject to the following conditions:
 
12
 
 
13
The above copyright notice and this permission notice shall be included in
 
14
all copies or substantial portions of the Software.
 
15
 
 
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
17
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
19
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
20
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 
21
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 
22
DEALINGS IN THE SOFTWARE.
 
23
******************************************************************/
 
24
 
 
25
#include "kdecorationfactory.h"
 
26
 
 
27
#include <assert.h>
 
28
 
 
29
#include "kdecorationbridge.h"
 
30
 
 
31
KDecorationFactory::KDecorationFactory()
 
32
{
 
33
}
 
34
 
 
35
KDecorationFactory::~KDecorationFactory()
 
36
{
 
37
    assert(_decorations.count() == 0);
 
38
}
 
39
 
 
40
bool KDecorationFactory::reset(unsigned long)
 
41
{
 
42
    return true;
 
43
}
 
44
 
 
45
void KDecorationFactory::checkRequirements(KDecorationProvides*)
 
46
{
 
47
}
 
48
 
 
49
QList< KDecorationDefines::BorderSize > KDecorationFactory::borderSizes() const
 
50
{
 
51
    return QList< BorderSize >() << BorderNormal;
 
52
}
 
53
 
 
54
bool KDecorationFactory::exists(const KDecoration* deco) const
 
55
{
 
56
    return _decorations.contains(const_cast< KDecoration* >(deco));
 
57
}
 
58
 
 
59
void KDecorationFactory::addDecoration(KDecoration* deco)
 
60
{
 
61
    _decorations.append(deco);
 
62
}
 
63
 
 
64
void KDecorationFactory::removeDecoration(KDecoration* deco)
 
65
{
 
66
    _decorations.removeAll(deco);
 
67
}
 
68
 
 
69
void KDecorationFactory::resetDecorations(unsigned long changed)
 
70
{
 
71
    for (QList< KDecoration* >::ConstIterator it = _decorations.constBegin();
 
72
            it != _decorations.constEnd();
 
73
            ++it)
 
74
        (*it)->reset(changed);
 
75
}
 
76
 
 
77
NET::WindowType KDecorationFactory::windowType(unsigned long supported_types, KDecorationBridge* bridge) const
 
78
{
 
79
    return bridge->windowType(supported_types);
 
80
}