source: trunk/src/gui/image/qpicture_p.h@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 5.6 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** This file is part of the QtGui module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial Usage
10** Licensees holding valid Qt Commercial licenses may use this file in
11** accordance with the Qt Commercial License Agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Nokia.
14**
15** GNU Lesser General Public License Usage
16** Alternatively, this file may be used under the terms of the GNU Lesser
17** General Public License version 2.1 as published by the Free Software
18** Foundation and appearing in the file LICENSE.LGPL included in the
19** packaging of this file. Please review the following information to
20** ensure the GNU Lesser General Public License version 2.1 requirements
21** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22**
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.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you are unsure which license is appropriate for your use, please
37** contact the sales department at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QPICTURE_P_H
43#define QPICTURE_P_H
44
45//
46// W A R N I N G
47// -------------
48//
49// This file is not part of the Qt API. It exists purely as an
50// implementation detail. This header file may change from version to
51// version without notice, or even be removed.
52//
53// We mean it.
54//
55
56#include "QtCore/qatomic.h"
57#include "QtCore/qbuffer.h"
58#include "QtCore/qobjectdefs.h"
59#include "QtGui/qpicture.h"
60#include "QtGui/qpixmap.h"
61#include "QtGui/qpen.h"
62#include "QtGui/qbrush.h"
63#include "QtCore/qrect.h"
64#include "private/qobject_p.h"
65
66QT_BEGIN_NAMESPACE
67
68class QPaintEngine;
69
70extern const char *qt_mfhdr_tag;
71
72class Q_GUI_EXPORT QPicturePrivate
73{
74 Q_DECLARE_PUBLIC(QPicture)
75 friend class QPicturePaintEngine;
76 friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &s, const QPicture &r);
77 friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &s, QPicture &r);
78
79public:
80 enum PaintCommand {
81 PdcNOP = 0, // <void>
82 PdcDrawPoint = 1, // point
83 PdcDrawFirst = PdcDrawPoint,
84 PdcMoveTo = 2, // point
85 PdcLineTo = 3, // point
86 PdcDrawLine = 4, // point,point
87 PdcDrawRect = 5, // rect
88 PdcDrawRoundRect = 6, // rect,ival,ival
89 PdcDrawEllipse = 7, // rect
90 PdcDrawArc = 8, // rect,ival,ival
91 PdcDrawPie = 9, // rect,ival,ival
92 PdcDrawChord = 10, // rect,ival,ival
93 PdcDrawLineSegments = 11, // ptarr
94 PdcDrawPolyline = 12, // ptarr
95 PdcDrawPolygon = 13, // ptarr,ival
96 PdcDrawCubicBezier = 14, // ptarr
97 PdcDrawText = 15, // point,str
98 PdcDrawTextFormatted = 16, // rect,ival,str
99 PdcDrawPixmap = 17, // rect,pixmap
100 PdcDrawImage = 18, // rect,image
101 PdcDrawText2 = 19, // point,str
102 PdcDrawText2Formatted = 20, // rect,ival,str
103 PdcDrawTextItem = 21, // pos,text,font,flags
104 PdcDrawLast = PdcDrawTextItem,
105 PdcDrawPoints = 22, // ptarr,ival,ival
106 PdcDrawWinFocusRect = 23, // rect,color
107 PdcDrawTiledPixmap = 24, // rect,pixmap,point
108 PdcDrawPath = 25, // path
109
110 // no painting commands below PdcDrawLast.
111
112 PdcBegin = 30, // <void>
113 PdcEnd = 31, // <void>
114 PdcSave = 32, // <void>
115 PdcRestore = 33, // <void>
116 PdcSetdev = 34, // device - PRIVATE
117 PdcSetBkColor = 40, // color
118 PdcSetBkMode = 41, // ival
119 PdcSetROP = 42, // ival
120 PdcSetBrushOrigin = 43, // point
121 PdcSetFont = 45, // font
122 PdcSetPen = 46, // pen
123 PdcSetBrush = 47, // brush
124 PdcSetTabStops = 48, // ival
125 PdcSetTabArray = 49, // ival,ivec
126 PdcSetUnit = 50, // ival
127 PdcSetVXform = 51, // ival
128 PdcSetWindow = 52, // rect
129 PdcSetViewport = 53, // rect
130 PdcSetWXform = 54, // ival
131 PdcSetWMatrix = 55, // matrix,ival
132 PdcSaveWMatrix = 56,
133 PdcRestoreWMatrix = 57,
134 PdcSetClip = 60, // ival
135 PdcSetClipRegion = 61, // rgn
136 PdcSetClipPath = 62, // path
137 PdcSetRenderHint = 63, // ival
138 PdcSetCompositionMode = 64, // ival
139 PdcSetClipEnabled = 65, // bool
140 PdcSetOpacity = 66, // qreal
141
142 PdcReservedStart = 0, // codes 0-199 are reserved
143 PdcReservedStop = 199 // for Qt
144 };
145
146 inline QPicturePrivate() : in_memory_only(false), q_ptr(0) { ref = 1; }
147 QAtomicInt ref;
148
149 bool checkFormat();
150 void resetFormat();
151
152 QBuffer pictb;
153 int trecs;
154 bool formatOk;
155 int formatMajor;
156 int formatMinor;
157 QRect brect;
158 QRect override_rect;
159 QPaintEngine *paintEngine;
160 bool in_memory_only;
161 QList<QImage> image_list;
162 QList<QPixmap> pixmap_list;
163 QList<QBrush> brush_list;
164 QList<QPen> pen_list;
165
166 QPicture *q_ptr;
167};
168
169QT_END_NAMESPACE
170
171#endif // QPICTURE_P_H
Note: See TracBrowser for help on using the repository browser.