~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/gui/image/qpicture_p.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
**
 
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
 
4
**
 
5
** This file is part of the painting module of the Qt Toolkit.
 
6
**
 
7
** This file may be distributed under the terms of the Q Public License
 
8
** as defined by Trolltech AS of Norway and appearing in the file
 
9
** LICENSE.QPL included in the packaging of this file.
 
10
**
 
11
** This file may be distributed and/or modified under the terms of the
 
12
** GNU General Public License version 2 as published by the Free Software
 
13
** Foundation and appearing in the file LICENSE.GPL included in the
 
14
** packaging of this file.
 
15
**
 
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
 
17
**   information about Qt Commercial License Agreements.
 
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
 
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
 
20
**
 
21
** Contact info@trolltech.com if any conditions of this licensing are
 
22
** not clear to you.
 
23
**
 
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
 
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
26
**
 
27
****************************************************************************/
 
28
 
 
29
#ifndef QPICTURE_P_H
 
30
#define QPICTURE_P_H
 
31
 
 
32
//
 
33
//  W A R N I N G
 
34
//  -------------
 
35
//
 
36
// This file is not part of the Qt API.  It exists purely as an
 
37
// implementation detail.  This header file may change from version to
 
38
// version without notice, or even be removed.
 
39
//
 
40
// We mean it.
 
41
//
 
42
 
 
43
#include <qatomic.h>
 
44
#include <qbuffer.h>
 
45
#include <qobjectdefs.h>
 
46
#include <qpicture.h>
 
47
#include <qrect.h>
 
48
#include <private/qobject_p.h>
 
49
 
 
50
class QPaintEngine;
 
51
 
 
52
extern const char  *qt_mfhdr_tag;
 
53
extern const quint16 mfhdr_maj;
 
54
extern const quint16 mfhdr_min;
 
55
 
 
56
class Q_GUI_EXPORT QPicturePrivate
 
57
{
 
58
    Q_DECLARE_PUBLIC(QPicture)
 
59
    friend class QPicturePaintEngine;
 
60
    friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &s, const QPicture &r);
 
61
    friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &s, QPicture &r);
 
62
 
 
63
public:
 
64
    enum PaintCommand {
 
65
        PdcNOP = 0, //  <void>
 
66
        PdcDrawPoint = 1, // point
 
67
        PdcDrawFirst = PdcDrawPoint,
 
68
        PdcMoveTo = 2, // point
 
69
        PdcLineTo = 3, // point
 
70
        PdcDrawLine = 4, // point,point
 
71
        PdcDrawRect = 5, // rect
 
72
        PdcDrawRoundRect = 6, // rect,ival,ival
 
73
        PdcDrawEllipse = 7, // rect
 
74
        PdcDrawArc = 8, // rect,ival,ival
 
75
        PdcDrawPie = 9, // rect,ival,ival
 
76
        PdcDrawChord = 10, // rect,ival,ival
 
77
        PdcDrawLineSegments = 11, // ptarr
 
78
        PdcDrawPolyline = 12, // ptarr
 
79
        PdcDrawPolygon = 13, // ptarr,ival
 
80
        PdcDrawCubicBezier = 14, // ptarr
 
81
        PdcDrawText = 15, // point,str
 
82
        PdcDrawTextFormatted = 16, // rect,ival,str
 
83
        PdcDrawPixmap = 17, // rect,pixmap
 
84
        PdcDrawImage = 18, // rect,image
 
85
        PdcDrawText2 = 19, // point,str
 
86
        PdcDrawText2Formatted = 20, // rect,ival,str
 
87
        PdcDrawTextItem = 21,
 
88
        PdcDrawLast = PdcDrawTextItem,
 
89
        PdcDrawPoints = 22, // ptarr,ival,ival
 
90
        PdcDrawWinFocusRect = 23, // rect,color
 
91
        PdcDrawTiledPixmap = 24, // rect,pixmap,point
 
92
        PdcDrawPath = 25, // path
 
93
 
 
94
        // no painting commands below PdcDrawLast.
 
95
 
 
96
        PdcBegin = 30, //  <void>
 
97
        PdcEnd = 31, //  <void>
 
98
        PdcSave = 32, //  <void>
 
99
        PdcRestore = 33, //  <void>
 
100
        PdcSetdev = 34, // device - PRIVATE
 
101
        PdcSetBkColor = 40, // color
 
102
        PdcSetBkMode = 41, // ival
 
103
        PdcSetROP = 42, // ival
 
104
        PdcSetBrushOrigin = 43, // point
 
105
        PdcSetFont = 45, // font
 
106
        PdcSetPen = 46, // pen
 
107
        PdcSetBrush = 47, // brush
 
108
        PdcSetTabStops = 48, // ival
 
109
        PdcSetTabArray = 49, // ival,ivec
 
110
        PdcSetUnit = 50, // ival
 
111
        PdcSetVXform = 51, // ival
 
112
        PdcSetWindow = 52, // rect
 
113
        PdcSetViewport = 53, // rect
 
114
        PdcSetWXform = 54, // ival
 
115
        PdcSetWMatrix = 55, // matrix,ival
 
116
        PdcSaveWMatrix = 56,
 
117
        PdcRestoreWMatrix = 57,
 
118
        PdcSetClip = 60, // ival
 
119
        PdcSetClipRegion = 61, // rgn
 
120
        PdcSetClipPath = 62, // path
 
121
        PdcSetRenderHint = 63, // ival
 
122
 
 
123
        PdcReservedStart = 0, // codes 0-199 are reserved
 
124
        PdcReservedStop = 199 //   for Qt
 
125
    };
 
126
 
 
127
    inline QPicturePrivate() : q_ptr(0) { ref = 1; }
 
128
    QAtomic ref;
 
129
 
 
130
    bool checkFormat();
 
131
    void resetFormat();
 
132
 
 
133
    QBuffer pictb;
 
134
    int trecs;
 
135
    bool formatOk;
 
136
    int formatMajor;
 
137
    int formatMinor;
 
138
    QRect brect;
 
139
    QPaintEngine *paintEngine;
 
140
 
 
141
    QPicture *q_ptr;
 
142
};
 
143
 
 
144
#endif // QPICTURE_P_H