[iOS] Upstream WebEventRegion.{h|mm} to fix the build
authorddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 16:09:49 +0000 (16:09 +0000)
committerddkilzer@apple.com <ddkilzer@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 12 Jan 2014 16:09:49 +0000 (16:09 +0000)
* WebCore.xcodeproj/project.pbxproj: Add to project.
* page/ios/WebEventRegion.h: Added.
* page/ios/WebEventRegion.mm: Added.
(-[WebEventRegion initWithPoints::::]):
(-[WebEventRegion copyWithZone:]):
(-[WebEventRegion description]):
(-[WebEventRegion hitTest:]):
(-[WebEventRegion isEqual:]):
(-[WebEventRegion quad]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161806 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/ios/WebEventRegion.h [new file with mode: 0644]
Source/WebCore/page/ios/WebEventRegion.mm [new file with mode: 0644]

index 14de5c8382bf107e7901a3a91293a75e41516843..fdefeeefd84523098db0620923293e372120949f 100644 (file)
@@ -1,3 +1,17 @@
+2014-01-12  David Kilzer  <ddkilzer@apple.com>
+
+        [iOS] Upstream WebEventRegion.{h|mm} to fix the build
+
+        * WebCore.xcodeproj/project.pbxproj: Add to project.
+        * page/ios/WebEventRegion.h: Added.
+        * page/ios/WebEventRegion.mm: Added.
+        (-[WebEventRegion initWithPoints::::]):
+        (-[WebEventRegion copyWithZone:]):
+        (-[WebEventRegion description]):
+        (-[WebEventRegion hitTest:]):
+        (-[WebEventRegion isEqual:]):
+        (-[WebEventRegion quad]):
+
 2014-01-11  Anders Carlsson  <andersca@apple.com>
 
         Use std::call_once instead of AtomicallyInitializedStatic when creating a HTTP header set
index 6527c3defa55a469a5244aa83c07f1a315145c38..b9b000668379d15000cd5aef76a11bcb81dce177 100644 (file)
                209B456B16796A7E00E54E4E /* JSCryptoCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 209B456A16796A7E00E54E4E /* JSCryptoCustom.cpp */; };
                20D629261253690B00081543 /* InspectorInstrumentation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 20D629241253690B00081543 /* InspectorInstrumentation.cpp */; };
                20D629271253690B00081543 /* InspectorInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 20D629251253690B00081543 /* InspectorInstrumentation.h */; };
+               225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */ = {isa = PBXBuildFile; fileRef = 225A16B30D5C11E900090295 /* WebEventRegion.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               225A16B60D5C11E900090295 /* WebEventRegion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 225A16B40D5C11E900090295 /* WebEventRegion.mm */; };
                227777601345DEA9008EA455 /* InspectorForwarding.h in Headers */ = {isa = PBXBuildFile; fileRef = 2277775F1345DEA9008EA455 /* InspectorForwarding.h */; settings = {ATTRIBUTES = (Private, ); }; };
                228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2292B27C1356669400CF11EF /* ImageBufferDataCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2292B27B1356669400CF11EF /* ImageBufferDataCG.cpp */; };
                209B456A16796A7E00E54E4E /* JSCryptoCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCryptoCustom.cpp; sourceTree = "<group>"; };
                20D629241253690B00081543 /* InspectorInstrumentation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorInstrumentation.cpp; sourceTree = "<group>"; };
                20D629251253690B00081543 /* InspectorInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorInstrumentation.h; sourceTree = "<group>"; };
+               225A16B30D5C11E900090295 /* WebEventRegion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebEventRegion.h; sourceTree = "<group>"; };
+               225A16B40D5C11E900090295 /* WebEventRegion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEventRegion.mm; sourceTree = "<group>"; };
                2277775F1345DEA9008EA455 /* InspectorForwarding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorForwarding.h; sourceTree = "<group>"; };
                228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
                2292B27B1356669400CF11EF /* ImageBufferDataCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageBufferDataCG.cpp; sourceTree = "<group>"; };
                        children = (
                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
+                               225A16B30D5C11E900090295 /* WebEventRegion.h */,
+                               225A16B40D5C11E900090295 /* WebEventRegion.mm */,
                        );
                        path = ios;
                        sourceTree = "<group>";
                                93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
                                37F818FD0D657606005E1F05 /* WebCoreURLResponse.h in Headers */,
                                93F199F008245E59001E9ABC /* WebCoreView.h in Headers */,
+                               225A16B50D5C11E900090295 /* WebEventRegion.h in Headers */,
                                BC6DADEF0A195FDF00E5CD14 /* WebFontCache.h in Headers */,
                                A7D20F6D107F438B00A80392 /* WebGLActiveInfo.h in Headers */,
                                07C59B5717F4AC15000FBCBB /* VideoStreamTrack.h in Headers */,
                                93EB169509F880B00091F8FF /* WebCoreSystemInterface.mm in Sources */,
                                37F818FE0D657606005E1F05 /* WebCoreURLResponse.mm in Sources */,
                                93F19B0708245E59001E9ABC /* WebCoreView.m in Sources */,
+                               225A16B60D5C11E900090295 /* WebEventRegion.mm in Sources */,
                                BC6DADFA0A19602B00E5CD14 /* WebFontCache.mm in Sources */,
                                C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */,
                                49C7B9C81042D32F0009D447 /* WebGLBuffer.cpp in Sources */,
diff --git a/Source/WebCore/page/ios/WebEventRegion.h b/Source/WebCore/page/ios/WebEventRegion.h
new file mode 100644 (file)
index 0000000..9cb9081
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2008, 2009 Apple 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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.
+ */
+
+#ifndef WebEventRegion_h
+#define WebEventRegion_h
+
+#if ENABLE(TOUCH_EVENTS)
+
+#import <CoreGraphics/CGGeometry.h>
+#import <Foundation/NSObject.h>
+
+@interface WebEventRegion : NSObject <NSCopying>
+{
+    CGPoint p1, p2, p3, p4;
+}
+- (id)initWithPoints:(CGPoint)inP1 :(CGPoint)inP2 :(CGPoint)inP3 :(CGPoint)inP4;
+- (BOOL)hitTest:(CGPoint)point;
+@end
+
+#endif // ENABLE(TOUCH_EVENTS)
+
+#endif // WebEventRegion_h
diff --git a/Source/WebCore/page/ios/WebEventRegion.mm b/Source/WebCore/page/ios/WebEventRegion.mm
new file mode 100644 (file)
index 0000000..01bb150
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2008, 2009 Apple 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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.
+ */
+
+#import "config.h"
+#import "WebEventRegion.h"
+#if ENABLE(TOUCH_EVENTS)
+
+#import "FloatQuad.h"
+
+using namespace WebCore;
+
+@interface WebEventRegion(Private)
+- (FloatQuad)quad;
+@end
+
+@implementation WebEventRegion
+
+- (id)initWithPoints:(CGPoint)inP1 :(CGPoint)inP2 :(CGPoint)inP3 :(CGPoint)inP4
+{
+    if (!(self = [super init]))
+        return nil;
+        
+    p1 = inP1;
+    p2 = inP2;
+    p3 = inP3;
+    p4 = inP4;
+    return self;
+}
+
+- (id)copyWithZone:(NSZone *)zone
+{
+    UNUSED_PARAM(zone);
+    return [self retain];
+}
+
+- (NSString *)description
+{
+    return [NSString stringWithFormat:@"p1:{%g, %g} p2:{%g, %g} p3:{%g, %g} p4:{%g, %g}", p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y];
+}
+
+- (BOOL)hitTest:(CGPoint)point
+{
+    return [self quad].containsPoint(point);
+}
+
+- (BOOL)isEqual:(id)other
+{
+    return  CGPointEqualToPoint(p1, ((WebEventRegion *)other)->p1) &&
+            CGPointEqualToPoint(p2, ((WebEventRegion *)other)->p2) &&
+            CGPointEqualToPoint(p3, ((WebEventRegion *)other)->p3) &&
+            CGPointEqualToPoint(p4, ((WebEventRegion *)other)->p4);
+}
+
+- (FloatQuad)quad
+{
+    return FloatQuad(p1, p2, p3, p4);
+}
+
+@end
+
+#endif // ENABLE(TOUCH_EVENTS)