~ubuntu-branches/ubuntu/lucid/kdebase/lucid

« back to all changes in this revision

Viewing changes to kdm/kfrontend/themer/kdmpixmap.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-27 12:09:48 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080527120948-dottsyd5rcwhzd36
Tags: 4:4.0.80-1ubuntu1
* Merge with Debian
 - remove 97_fix_target_link_libraries.diff
 - Add replaces/conflicts on -kde4 packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *  Copyright (C) 2003 by Unai Garro <ugarro@users.sourceforge.net>
3
 
 *  Copyright (C) 2004 by Enrico Ros <rosenric@dei.unipd.it>
4
 
 *  Copyright (C) 2004 by Stephan Kulow <coolo@kde.org>
5
 
 *  Copyright (C) 2004 by Oswald Buddenhagen <ossi@kde.org>
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; either version 2 of the License, or
10
 
 *  (at your option) any later version.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20
 
 */
21
 
 
22
 
#ifndef KDMPIXMAP_H
23
 
#define KDMPIXMAP_H
24
 
 
25
 
#include "kdmitem.h"
26
 
 
27
 
//#include <qrect.h>
28
 
#include <qpixmap.h>
29
 
 
30
 
/*
31
 
 * KdmPixmap. A pixmap element
32
 
 */
33
 
 
34
 
class KdmPixmap : public KdmItem {
35
 
        Q_OBJECT
36
 
 
37
 
public:
38
 
        KdmPixmap( KdmItem *parent, const QDomNode &node, const char *name = 0 );
39
 
 
40
 
protected:
41
 
        // reimplemented; returns the size of loaded pixmap
42
 
        virtual QSize sizeHint();
43
 
 
44
 
        // draw the pixmap
45
 
        virtual void drawContents( QPainter *p, const QRect &r );
46
 
 
47
 
        // handle switching between normal / active / prelight configurations
48
 
        virtual void statusChanged();
49
 
 
50
 
        virtual void setGeometry( const QRect &newGeometry, bool force );
51
 
 
52
 
        struct PixmapStruct {
53
 
                struct PixmapClass {
54
 
                        QString fullpath;
55
 
                        QPixmap pixmap;
56
 
                        QPixmap readyPixmap;
57
 
                        QColor tint;
58
 
                        float alpha;    //TODO added: not in greeter.dtd
59
 
                        bool present;
60
 
                } normal, active, prelight;
61
 
        } pixmap;
62
 
 
63
 
private:
64
 
        // Method to load the pixmap given by the theme
65
 
        void loadPixmap( const QString &fileName, QPixmap &p, QString &path );
66
 
        void renderSvg( PixmapStruct::PixmapClass *pClass, const QRect &area );
67
 
};
68
 
 
69
 
#endif