Back to index

kdeartwork  4.3.2
frame.h
Go to the documentation of this file.
00001 /*
00002  * Asciiquarium - Native KDE Screensaver based on the Asciiquarium program
00003  *    (c) Kirk Baucom <kbaucom@schizoid.com>, which you can find at
00004  *    http://www.robobunny.com/projects/asciiquarium/
00005  *
00006  * Ported to KDE by Maksim Orlovich <maksim@kde.org> and
00007  * Michael Pyne <michael.pyne@kdemail.net>.
00008  *
00009  * Copyright (c) 2003 Kirk Baucom     <kbaucom@schizoid.com>
00010  * Copyright (c) 2005 Maksim Orlovich <maksim@kde.org>
00011  * Copyright (c) 2005, 2008 Michael Pyne <michael.pyne@kdemail.net>
00012  *
00013  * This program is free software; you can redistribute it and/or
00014  * modify it under the terms of the GNU General Public License
00015  * as published by the Free Software Foundation; either version 2
00016  * of the License, or (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License along with
00024  * this program; if not, write to the Free Software Foundation, Inc., 51
00025  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
00026  */
00027 
00028 #ifndef AA_FRAME_H
00029 #define AA_FRAME_H
00030 
00031 #include <QtCore/QString>
00032 #include <QtCore/QVector>
00033 #include <QtGui/QPixmap>
00034 
00035 #include "screen.h"
00036 
00042 class Frame
00043 {
00051     QVector<QVector<Screen::Pixel> > m_data;
00052 
00054     QPixmap m_pixmap;
00055 
00057     QPixmap m_erasePixmap;
00058 
00060     int m_height;
00061 
00063     int m_width;
00064 
00067     QChar m_transparentChar;
00068 
00069 public:
00070 
00074     Frame() : m_height(0), m_width(0)
00075     {
00076     }
00077 
00104     Frame(const QString& text, const QString& mask, const QRgb& defaultColor, QChar transparent = '?');
00105 
00113     void paint(Screen* scr, int x, int y);
00114 
00122     void erase(Screen* scr, int x, int y);
00123 
00125     int width() const
00126     {
00127         return m_width;
00128     }
00129 
00131     int height() const
00132     {
00133         return m_height;
00134     }
00135 
00136 protected:
00137 
00146     void convertDataToPixmap(const Screen *screen);
00147 };
00148 
00149 #endif
00150 
00151 // vim: set et ts=8 sw=4: