source: trunk/src/gui/painting/qregion_pm.cpp@ 100

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

gui: Implemented widget show/hide functions. Added widget mask (clip region) helpers.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Date Revision Author Id
File size: 4.8 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
4** Contact: Qt Software Information ([email protected])
5**
6** Copyright (C) 2009 netlabs.org. OS/2 parts.
7**
8** This file is part of the QtGui module of the Qt Toolkit.
9**
10** $QT_BEGIN_LICENSE:LGPL$
11** Commercial Usage
12** Licensees holding valid Qt Commercial licenses may use this file in
13** accordance with the Qt Commercial License Agreement provided with the
14** Software or, alternatively, in accordance with the terms contained in
15** a written agreement between you and Nokia.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Nokia gives you certain
26** additional rights. These rights are described in the Nokia Qt LGPL
27** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
28** package.
29**
30** GNU General Public License Usage
31** Alternatively, this file may be used under the terms of the GNU
32** General Public License version 3.0 as published by the Free Software
33** Foundation and appearing in the file LICENSE.GPL included in the
34** packaging of this file. Please review the following information to
35** ensure the GNU General Public License version 3.0 requirements will be
36** met: http://www.gnu.org/copyleft/gpl.html.
37**
38** If you are unsure which license is appropriate for your use, please
39** contact the sales department at [email protected].
40** $QT_END_LICENSE$
41**
42****************************************************************************/
43
44#include "qbitmap.h"
45#include "qbuffer.h"
46#include "qimage.h"
47#include "qpolygon.h"
48#include "qregion.h"
49
50QT_BEGIN_NAMESPACE
51
52QRegion::QRegionData QRegion::shared_empty = { Q_BASIC_ATOMIC_INITIALIZER(1) }; // @todo, 0 };
53
54QRegion::QRegion()
55 : d(&shared_empty)
56{
57 d->ref.ref();
58}
59
60QRegion::QRegion(const QRect &r, RegionType t)
61{
62 d = new QRegionData;
63 d->ref = 1;
64 // @todo implement
65}
66
67QRegion::QRegion(const QPolygon &a, Qt::FillRule fillRule)
68{
69 d = new QRegionData;
70 d->ref = 1;
71 // @todo implement
72}
73
74QRegion::QRegion(const QRegion &r)
75{
76 d = r.d;
77 d->ref.ref();
78}
79
80QRegion::QRegion(const QBitmap &bm)
81{
82 d = new QRegionData;
83 d->ref = 1;
84 // @todo implement
85}
86
87void QRegion::cleanUp(QRegion::QRegionData *x)
88{
89 delete x;
90 // @todo implement
91}
92
93QRegion::~QRegion()
94{
95 if (!d->ref.deref())
96 cleanUp(d);
97}
98
99QRegion &QRegion::operator=(const QRegion &r)
100{
101 r.d->ref.ref();
102 if (!d->ref.deref())
103 cleanUp(d);
104 d = r.d;
105 return *this;
106}
107
108
109QRegion QRegion::copy() const
110{
111 // @todo implement
112 return QRegion();
113}
114
115bool QRegion::isEmpty() const
116{
117 return (d == &shared_empty || boundingRect().isEmpty());
118}
119
120
121bool QRegion::contains(const QPoint &p) const
122{
123 // @todo implement
124 return false;
125}
126
127bool QRegion::contains(const QRect &r) const
128{
129 // @todo implement
130 return false;
131}
132
133
134void QRegion::translate(int dx, int dy)
135{
136 // @todo implement
137}
138
139QRegion QRegion::unite(const QRegion &r) const
140{
141 // @todo implement
142 return QRegion();
143}
144
145QRegion QRegion::unite(const QRect &r) const
146{
147 return unite(QRegion(r));
148}
149
150QRegion QRegion::intersect(const QRegion &r) const
151{
152 // @todo implement
153 return QRegion();
154}
155
156QRegion QRegion::subtract(const QRegion &r) const
157{
158 // @todo implement
159 return QRegion();
160}
161
162QRegion QRegion::eor(const QRegion &r) const
163{
164 // @todo implement
165 return QRegion();
166}
167
168
169QRect QRegion::boundingRect() const
170{
171 // @todo implement
172 return QRect();
173}
174
175QVector<QRect> QRegion::rects() const
176{
177 // @todo implement
178 return QVector<QRect>();
179}
180
181void QRegion::setRects(const QRect *rects, int num)
182{
183 *this = QRegion();
184 if (!rects || num == 0 || (num == 1 && rects->isEmpty()))
185 return;
186 for (int i = 0; i < num; ++i)
187 *this |= rects[i];
188}
189
190int QRegion::numRects() const
191{
192 // @todo implement
193 return 0;
194}
195
196bool QRegion::operator==(const QRegion &r) const
197{
198 // @todo implement
199 return false;
200}
201
202QRegion& QRegion::operator+=(const QRegion &r)
203{
204 // @todo implement
205 return *this;
206}
207
208QRegion& QRegion::operator-=(const QRegion &r)
209{
210 // @todo implement
211 return *this;
212}
213
214QRegion& QRegion::operator&=(const QRegion &r)
215{
216 // @todo implement
217 return *this;
218}
219
220bool qt_region_strictContains(const QRegion &region, const QRect &rect)
221{
222 Q_UNUSED(region);
223 Q_UNUSED(rect);
224 return false;
225}
226
227QT_END_NAMESPACE
Note: See TracBrowser for help on using the repository browser.