src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the plugins of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef QDIRECFBWINDOWSURFACE_H
       
    43 #define QDIRECFBWINDOWSURFACE_H
       
    44 
       
    45 #include "qdirectfbpaintengine.h"
       
    46 #include "qdirectfbpaintdevice.h"
       
    47 #include "qdirectfbscreen.h"
       
    48 
       
    49 #ifndef QT_NO_QWS_DIRECTFB
       
    50 
       
    51 #include <private/qpaintengine_raster_p.h>
       
    52 #include <private/qwindowsurface_qws_p.h>
       
    53 
       
    54 #ifdef QT_DIRECTFB_TIMING
       
    55 #include <qdatetime.h>
       
    56 #endif
       
    57 
       
    58 QT_BEGIN_HEADER
       
    59 
       
    60 QT_BEGIN_NAMESPACE
       
    61 
       
    62 QT_MODULE(Gui)
       
    63 
       
    64 class QDirectFBWindowSurface : public QWSWindowSurface, public QDirectFBPaintDevice
       
    65 {
       
    66 public:
       
    67     QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr);
       
    68     QDirectFBWindowSurface(DFBSurfaceFlipFlags flipFlags, QDirectFBScreen *scr, QWidget *widget);
       
    69     ~QDirectFBWindowSurface();
       
    70 
       
    71 #ifdef QT_DIRECTFB_WM
       
    72     void raise();
       
    73 #endif
       
    74     bool isValid() const;
       
    75 
       
    76     void setGeometry(const QRect &rect);
       
    77 
       
    78     QString key() const { return QLatin1String("directfb"); }
       
    79     QByteArray permanentState() const;
       
    80     void setPermanentState(const QByteArray &state);
       
    81 
       
    82     bool scroll(const QRegion &area, int dx, int dy);
       
    83 
       
    84     bool move(const QPoint &offset);
       
    85 
       
    86     QImage image() const { return QImage(); }
       
    87     QPaintDevice *paintDevice() { return this; }
       
    88 
       
    89     void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
       
    90 
       
    91     void beginPaint(const QRegion &);
       
    92     void endPaint(const QRegion &);
       
    93 
       
    94     IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
       
    95     IDirectFBSurface *directFBSurface() const;
       
    96 #ifdef QT_DIRECTFB_WM
       
    97     IDirectFBWindow *directFBWindow() const;
       
    98 #endif
       
    99 private:
       
   100     void setOpaque(bool opaque);
       
   101     void updateFormat();
       
   102     void releaseSurface();
       
   103     QDirectFBWindowSurface *sibling;
       
   104 
       
   105 #ifdef QT_DIRECTFB_WM
       
   106     void createWindow(const QRect &rect);
       
   107     IDirectFBWindow *dfbWindow;
       
   108 #else
       
   109     enum Mode {
       
   110         Primary,
       
   111         Offscreen
       
   112     } mode;
       
   113 #endif
       
   114 
       
   115     DFBSurfaceFlipFlags flipFlags;
       
   116     bool noSystemBackground;
       
   117     bool boundingRectFlip;
       
   118 #ifdef QT_DIRECTFB_TIMING
       
   119     int frames;
       
   120     QTime timer;
       
   121 #endif
       
   122 };
       
   123 
       
   124 QT_END_NAMESPACE
       
   125 
       
   126 QT_END_HEADER
       
   127 
       
   128 #endif // QT_NO_QWS_DIRECTFB
       
   129 
       
   130 #endif // QDIRECFBWINDOWSURFACE_H