Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/painting/qdrawutil.h

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information (qt-info@nokia.com)
     4** All rights reserved.
     5** Contact: Nokia Corporation (qt-info@nokia.com)
    56**
    67** This file is part of the QtGui module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you have questions regarding the use of this file, please contact
     37** Nokia at qt-info@nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    4545#include <QtCore/qnamespace.h>
    4646#include <QtCore/qstring.h> // char*->QString conversion
    47 
     47#include <QtCore/qmargins.h>
     48#include <QtGui/qpixmap.h>
    4849QT_BEGIN_HEADER
    4950
     
    6162class QBrush;
    6263class QRect;
    63 class QPixmap;
    6464
    6565//
     
    134134#endif
    135135
     136struct QTileRules
     137{
     138    inline QTileRules(Qt::TileRule horizontalRule, Qt::TileRule verticalRule)
     139            : horizontal(horizontalRule), vertical(verticalRule) {}
     140    inline QTileRules(Qt::TileRule rule = Qt::StretchTile)
     141            : horizontal(rule), vertical(rule) {}
     142    Qt::TileRule horizontal;
     143    Qt::TileRule vertical;
     144};
     145
     146#ifndef Q_QDOC
     147// For internal use only.
     148namespace QDrawBorderPixmap
     149{
     150    enum DrawingHint
     151    {
     152        OpaqueTopLeft = 0x0001,
     153        OpaqueTop = 0x0002,
     154        OpaqueTopRight = 0x0004,
     155        OpaqueLeft = 0x0008,
     156        OpaqueCenter = 0x0010,
     157        OpaqueRight = 0x0020,
     158        OpaqueBottomLeft = 0x0040,
     159        OpaqueBottom = 0x0080,
     160        OpaqueBottomRight = 0x0100,
     161        OpaqueCorners = OpaqueTopLeft | OpaqueTopRight | OpaqueBottomLeft | OpaqueBottomRight,
     162        OpaqueEdges = OpaqueTop | OpaqueLeft | OpaqueRight | OpaqueBottom,
     163        OpaqueFrame = OpaqueCorners | OpaqueEdges,
     164        OpaqueAll = OpaqueCenter | OpaqueFrame
     165    };
     166
     167    Q_DECLARE_FLAGS(DrawingHints, DrawingHint)
     168}
     169#endif
     170
     171Q_GUI_EXPORT void qDrawBorderPixmap(QPainter *painter,
     172                                    const QRect &targetRect,
     173                                    const QMargins &targetMargins,
     174                                    const QPixmap &pixmap,
     175                                    const QRect &sourceRect,
     176                                    const QMargins &sourceMargins,
     177                                    const QTileRules &rules = QTileRules()
     178#ifndef Q_QDOC
     179                                    , QDrawBorderPixmap::DrawingHints hints = 0
     180#endif
     181                                    );
     182
     183inline void qDrawBorderPixmap(QPainter *painter,
     184                                           const QRect &target,
     185                                           const QMargins &margins,
     186                                           const QPixmap &pixmap)
     187{
     188    qDrawBorderPixmap(painter, target, margins, pixmap, pixmap.rect(), margins);
     189}
     190
     191// For internal use only.
     192namespace QDrawPixmaps
     193{
     194    struct Data
     195    {
     196        QPointF point;
     197        QRectF source;
     198        qreal scaleX;
     199        qreal scaleY;
     200        qreal rotation;
     201        qreal opacity;
     202    };
     203
     204    enum DrawingHint
     205    {
     206        OpaqueHint = 0x01
     207    };
     208
     209    Q_DECLARE_FLAGS(DrawingHints, DrawingHint)
     210}
     211
     212// This function is private and may change without notice. Do not use outside Qt!!!
     213Q_GUI_EXPORT void qDrawPixmaps(QPainter *painter, const QDrawPixmaps::Data *drawingData,
     214                               int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints = 0);
     215
    136216QT_END_NAMESPACE
    137217
Note: See TracChangeset for help on using the changeset viewer.