|  | Home · All Namespaces · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# svgalibscreen.h Example File
qws/svgalib/svgalibscreen.h

     /****************************************************************************
     **
     ** Copyright (C) 1992-$THISYEAR$ $TROLLTECH$. All rights reserved.
     **
     ** This file is part of the $MODULE$ of the Qt Toolkit.
     **
     ** $TROLLTECH_DUAL_LICENSE$
     **
     ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
     ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
     **
     ****************************************************************************/

     #ifndef SVGALIBSCREEN_H
     #define SVGALIBSCREEN_H

     #include <QScreen>

     #include <vga.h>
     #include <vgagl.h>

     class SvgalibScreen : public QScreen
     {
     public:
         SvgalibScreen(int displayId) : QScreen(displayId) {}
         ~SvgalibScreen() {}

         bool connect(const QString &displaySpec);
         bool initDevice();
         void shutdownDevice();
         void disconnect();

         void setMode(int, int, int) {}
         void blank(bool) {}

         void blit(const QImage &img, const QPoint &topLeft, const QRegion &region);
         void solidFill(const QColor &color, const QRegion &region);

         QWSWindowSurface* createSurface(QWidget *widget) const;
         QWSWindowSurface* createSurface(const QString &key) const;

     private:
         void initColorMap();
         void blit16To8(const QImage &image,
                        const QPoint &topLeft, const QRegion &region);
         void blit32To8(const QImage &image,
                        const QPoint &topLeft, const QRegion &region);

         GraphicsContext *context;
     };

     #endif // SVGALIBSCREEN_H