Add a patch file in libwmapro to make it easier to add the library and the decoder...
[kugel-rb.git] / utils / themeeditor / graphics / rbscreen.h
blob78bbcfd8b2d861ac51218b13331f1a804b337d7c
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2010 Robert Bieber
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef RBSCREEN_H
23 #define RBSCREEN_H
25 #include <QGraphicsItem>
27 #include "projectmodel.h"
29 class RBScreen : public QGraphicsItem
32 public:
33 RBScreen(ProjectModel* project = 0, QGraphicsItem *parent = 0);
34 virtual ~RBScreen();
36 QPainterPath shape() const;
37 QRectF boundingRect() const;
38 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
39 QWidget *widget);
41 int getWidth() const{ return width; }
42 int getHeight() const{ return height; }
44 static QString safeSetting(ProjectModel* project, QString key,
45 QString fallback)
47 if(project)
48 return project->getSetting(key, fallback);
49 else
50 return fallback;
53 static QColor stringToColor(QString str, QColor fallback);
56 private:
57 int width;
58 int height;
59 QColor bgColor;
60 QColor fgColor;
61 QPixmap* backdrop;
63 ProjectModel* project;
67 #endif // RBSCREEN_H