[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:51:01 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0f9373364281aaa50ed86de4790a58ea050f3a9d
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Oct 23 15:44:06 2001 +0000
Added
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/kwq/KWQRegion.mm b/WebCore/kwq/KWQRegion.mm
new file mode 100644
index 0000000..8c9c3eb
--- /dev/null
+++ b/WebCore/kwq/KWQRegion.mm
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <qregion.h>
+
+#include <kwqdebug.h>
+
+void QRegion::_initialize() {
+ data = calloc(1, sizeof(struct KWQRegionData));
+ data->type = Rectangle;
+}
+
+QRegion::QRegion()
+{
+ _initialize();
+ data->path = [[NSBezierPath bezierPath] retain];
+}
+
+QRegion::QRegion(const QRect &rect)
+{
+ NSRect nsrect;
+
+ _initialize();
+
+ nsrect = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
+
+ data->path = [[NSBezierPath bezierPathWithRect:nsrect] retain];
+}
+
+QRegion::QRegion(int x, int y, int w, int h, RegionType t=Rectangle)
+{
+ NSRect rect;
+
+ _initialize();
+ rect = NSMakeRect(x,y,w,h);
+
+ if (t == Rectangle) {
+ data->path = [[NSBezierPath bezierPathWithRect:rect] retain];
+ data->type = Rectangle;
+ }
+ else { // Ellipse
+ data->path = [[NSBezierPath bezierPathWithOvalInRect:rect] retain];
+ data->type = Ellipse;
+ }
+}
+
+QRegion::QRegion(const QPointArray &arr)
+{
+ _initialize();
+ _logNotYetImplemented();
+}
+
+QRegion::QRegion(const QRegion &other)
+{
+ _initialize();
+ data->path = [[NSBezierPath bezierPath] retain];
+ [data->path appendBezierPath:other.data->path];
+}
+
+QRegion::~QRegion()
+{
+ [data->path release];
+ free(data);
+}
+
+QRegion QRegion::intersect(const QRegion &) const
+{
+ _logNotYetImplemented();
+}
+
+bool QRegion::contains(const QPoint &point) const
+{
+ NSPoint nspoint;
+
+ nspoint = NSMakePoint(point.x(), point.y());
+
+ return [data->path containsPoint:nspoint] ? 1 : 0;
+}
+
+bool QRegion::isNull() const
+{
+ return [data->path elementCount] == 0 ? 1 : 0;
+}
+
+QRegion &QRegion::operator=(const QRegion &other)
+{
+ if (data->path) {
+ [data->path release];
+ }
+ data->path = [[NSBezierPath bezierPath] retain];
+ [data->path appendBezierPath:other.data->path];
+}
diff --git a/WebCore/src/kwq/KWQRegion.mm b/WebCore/src/kwq/KWQRegion.mm
new file mode 100644
index 0000000..8c9c3eb
--- /dev/null
+++ b/WebCore/src/kwq/KWQRegion.mm
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <qregion.h>
+
+#include <kwqdebug.h>
+
+void QRegion::_initialize() {
+ data = calloc(1, sizeof(struct KWQRegionData));
+ data->type = Rectangle;
+}
+
+QRegion::QRegion()
+{
+ _initialize();
+ data->path = [[NSBezierPath bezierPath] retain];
+}
+
+QRegion::QRegion(const QRect &rect)
+{
+ NSRect nsrect;
+
+ _initialize();
+
+ nsrect = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height());
+
+ data->path = [[NSBezierPath bezierPathWithRect:nsrect] retain];
+}
+
+QRegion::QRegion(int x, int y, int w, int h, RegionType t=Rectangle)
+{
+ NSRect rect;
+
+ _initialize();
+ rect = NSMakeRect(x,y,w,h);
+
+ if (t == Rectangle) {
+ data->path = [[NSBezierPath bezierPathWithRect:rect] retain];
+ data->type = Rectangle;
+ }
+ else { // Ellipse
+ data->path = [[NSBezierPath bezierPathWithOvalInRect:rect] retain];
+ data->type = Ellipse;
+ }
+}
+
+QRegion::QRegion(const QPointArray &arr)
+{
+ _initialize();
+ _logNotYetImplemented();
+}
+
+QRegion::QRegion(const QRegion &other)
+{
+ _initialize();
+ data->path = [[NSBezierPath bezierPath] retain];
+ [data->path appendBezierPath:other.data->path];
+}
+
+QRegion::~QRegion()
+{
+ [data->path release];
+ free(data);
+}
+
+QRegion QRegion::intersect(const QRegion &) const
+{
+ _logNotYetImplemented();
+}
+
+bool QRegion::contains(const QPoint &point) const
+{
+ NSPoint nspoint;
+
+ nspoint = NSMakePoint(point.x(), point.y());
+
+ return [data->path containsPoint:nspoint] ? 1 : 0;
+}
+
+bool QRegion::isNull() const
+{
+ return [data->path elementCount] == 0 ? 1 : 0;
+}
+
+QRegion &QRegion::operator=(const QRegion &other)
+{
+ if (data->path) {
+ [data->path release];
+ }
+ data->path = [[NSBezierPath bezierPath] retain];
+ [data->path appendBezierPath:other.data->path];
+}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list