[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:26:47 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 87fbff79f1d05db9ebaa8907d5dc28d987002bd3
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jul 24 01:33:28 2002 +0000
WebCore:
Initial plumbing for contextual menu support.
* WebCore.pbproj/project.pbxproj:
* kwq/KWQDOMNode.cpp: Added.
(isImage):
* kwq/KWQDOMNode.h: Added.
* kwq/WebCoreBridge.h:
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge _URLForDOMString:]): added
(-[WebCoreBridge _elementInfoForMouseEvent:]): added
WebKit:
Initial plumbing for contextual menu support.
* WebCoreSupport.subproj/WebBridge.h:
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge elementInfoForMouseEvent:]): added
* WebView.subproj/WebController.h:
* WebView.subproj/WebHTMLView.m:
(-[WebHTMLView menuForEvent:]): added
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index dbf203e..158e331 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,16 @@
+2002-07-23 Chris Blumenberg <cblu at apple.com>
+
+ Initial plumbing for contextual menu support.
+
+ * WebCore.pbproj/project.pbxproj:
+ * kwq/KWQDOMNode.cpp: Added.
+ (isImage):
+ * kwq/KWQDOMNode.h: Added.
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge _URLForDOMString:]): added
+ (-[WebCoreBridge _elementInfoForMouseEvent:]): added
+
2002-07-23 Richard Williamson (Local) <rjw at apple.com>
Turn on find related code in part in preparation for
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index dbf203e..158e331 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,16 @@
+2002-07-23 Chris Blumenberg <cblu at apple.com>
+
+ Initial plumbing for contextual menu support.
+
+ * WebCore.pbproj/project.pbxproj:
+ * kwq/KWQDOMNode.cpp: Added.
+ (isImage):
+ * kwq/KWQDOMNode.h: Added.
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge _URLForDOMString:]): added
+ (-[WebCoreBridge _elementInfoForMouseEvent:]): added
+
2002-07-23 Richard Williamson (Local) <rjw at apple.com>
Turn on find related code in part in preparation for
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index dbf203e..158e331 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,16 @@
+2002-07-23 Chris Blumenberg <cblu at apple.com>
+
+ Initial plumbing for contextual menu support.
+
+ * WebCore.pbproj/project.pbxproj:
+ * kwq/KWQDOMNode.cpp: Added.
+ (isImage):
+ * kwq/KWQDOMNode.h: Added.
+ * kwq/WebCoreBridge.h:
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge _URLForDOMString:]): added
+ (-[WebCoreBridge _elementInfoForMouseEvent:]): added
+
2002-07-23 Richard Williamson (Local) <rjw at apple.com>
Turn on find related code in part in preparation for
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 750f107..7998087 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -485,6 +485,7 @@
F5B2A4FE02E2220F018635CB,
F5B2A52D02E22573018635CB,
F565AE8702ECA583018635CA,
+ 354F248B02EE28590ACA2ACA,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -710,6 +711,7 @@
F54A61D402E3523B01A80180,
F57B0EE102EBC78B018635CA,
F565AE8802ECA583018635CA,
+ 354F248C02EE28590ACA2ACA,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -786,6 +788,38 @@
//252
//253
//254
+//350
+//351
+//352
+//353
+//354
+ 354F248902EE28590ACA2ACA = {
+ isa = PBXFileReference;
+ path = KWQDOMNode.h;
+ refType = 4;
+ };
+ 354F248A02EE28590ACA2ACA = {
+ isa = PBXFileReference;
+ path = KWQDOMNode.cpp;
+ refType = 4;
+ };
+ 354F248B02EE28590ACA2ACA = {
+ fileRef = 354F248902EE28590ACA2ACA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 354F248C02EE28590ACA2ACA = {
+ fileRef = 354F248A02EE28590ACA2ACA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+//350
+//351
+//352
+//353
+//354
//F50
//F51
//F52
@@ -821,6 +855,8 @@
F58784D302DE375901EA4122,
F58784D402DE375901EA4122,
F58784DA02DE375901EA4122,
+ 354F248902EE28590ACA2ACA,
+ 354F248A02EE28590ACA2ACA,
F58784E902DE375901EA4122,
F58784EA02DE375901EA4122,
F58784EE02DE375901EA4122,
diff --git a/WebCore/kwq/KWQFontInfo.mm b/WebCore/kwq/KWQDOMNode.cpp
similarity index 76%
copy from WebCore/kwq/KWQFontInfo.mm
copy to WebCore/kwq/KWQDOMNode.cpp
index ab5208b..812c717 100644
--- a/WebCore/kwq/KWQFontInfo.mm
+++ b/WebCore/kwq/KWQDOMNode.cpp
@@ -16,23 +16,18 @@
* 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
+ * 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.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <qfontinfo.h>
-#import <kwqdebug.h>
+#include "KWQDOMNode.h"
+#include <htmltags.h>
+#include <xml/dom_nodeimpl.h>
-QFontInfo::QFontInfo(const QFont &f)
- : font(f)
+bool isImage(DOM::NodeImpl *node)
{
-}
-
-bool QFontInfo::fixedPitch() const
-{
- _logNotYetImplemented();
- return FALSE;
-}
+ return(node->id() == ID_IMG);
+}
\ No newline at end of file
diff --git a/WebCore/kwq/KWQKPartsFactory.h b/WebCore/kwq/KWQDOMNode.h
similarity index 80%
copy from WebCore/kwq/KWQKPartsFactory.h
copy to WebCore/kwq/KWQDOMNode.h
index 5a85674..a73237b 100644
--- a/WebCore/kwq/KWQKPartsFactory.h
+++ b/WebCore/kwq/KWQDOMNode.h
@@ -16,21 +16,15 @@
* 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
+ * 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.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FACTORY_H_
-#define FACTORY_H_
-
-#include <part.h>
-
-namespace KParts {
- class Factory;
+namespace DOM {
+ class NodeImpl;
}
-#endif
-
+bool isImage(DOM::NodeImpl *);
\ No newline at end of file
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 9163c49..d2c6a5f 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -32,6 +32,7 @@ class KHTMLView;
namespace khtml {
class RenderPart;
+ class RenderObject;
}
typedef khtml::RenderPart KHTMLRenderPart;
@@ -51,6 +52,12 @@ typedef khtml::RenderPart KHTMLRenderPart;
@protocol WebCoreRenderTreeCopier;
@protocol WebCoreResourceLoader;
+#define WebCoreContextLinkURL @"WebCoreContextLinkURL"
+#define WebCoreContextImageURL @"WebCoreContextImageURL"
+#define WebCoreContextString @"WebCoreContextString"
+#define WebCoreContextImage @"WebCoreContextImage"
+#define WebCoreContextFrame @"WebCoreContextFrame"
+
// WebCoreBridge objects are used by WebCore to abstract away operations that need
// to be implemented by library clients, for example WebKit. The objects are also
// used in the opposite direction, for simple access to WebCore functions without dealing
@@ -108,6 +115,8 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier;
- (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier;
+- (NSDictionary *)_elementInfoForMouseEvent:(NSEvent *)event;
+
@end
// The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 3ebe8e8..cc4043c 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -28,11 +28,21 @@
#import <khtml_part.h>
#import <khtmlview.h>
#import <dom_docimpl.h>
+#import <render_object.h>
#import <render_root.h>
#import <render_frames.h>
#import <kwqdebug.h>
#include <html/html_documentimpl.h>
#include <xml/dom_nodeimpl.h>
+#include <htmlattrs.h>
+#include <htmltags.h>
+#include <csshelper.h>
+#include <KWQDOMNode.h>
+
+#include <WebFoundation/WebNSURLExtras.h>
+
+using namespace DOM;
+using namespace khtml;
@implementation WebCoreBridge
@@ -382,4 +392,53 @@
}
}
+- (NSURL *)_URLForDOMString:(DOMString &)s
+{
+ NSString *URLString = part->xmlDocImpl()->completeURL(s.string()).getNSString();
+ return [NSURL _web_URLWithString:URLString];
+}
+
+- (NSDictionary *)_elementInfoForMouseEvent:(NSEvent *)event
+{
+ NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
+ RenderObject::NodeInfo nodeInfo(true, true);
+ NodeImpl *node, *URLNode;
+ NSPoint pointInWindow;
+ DOMString domURL;
+ NSURL *URL;
+ int x, y;
+
+ pointInWindow = [event locationInWindow];
+ part->impl->getView()->viewportToContents((int)pointInWindow.x, (int)pointInWindow.y, x, y);
+ part->xmlDocImpl()->renderer()->nodeAtPoint(nodeInfo, x, y, 0, 0);
+
+ node = nodeInfo.innerNode();
+ URLNode = nodeInfo.URLElement();
+
+ if(URLNode){
+ ElementImpl* e = static_cast<ElementImpl*>(URLNode);
+ domURL = khtml::parseURL(e->getAttribute(ATTR_HREF));
+ URL = [self _URLForDOMString:domURL];
+ if(URL){
+ [elementInfo setObject: URL forKey: WebCoreContextLinkURL];
+ }
+ }
+
+ if(isImage(node)){
+ ElementImpl* i = static_cast<ElementImpl*>(node);
+ domURL = khtml::parseURL(i->getAttribute(ATTR_SRC));
+ URL = [self _URLForDOMString:domURL];
+ if(URL){
+ [elementInfo setObject: URL forKey: WebCoreContextImageURL];
+ }
+ }
+
+ //FIXME: THIS IS STILL A WORK IN PROGRESS
+
+ //NSLog([elementInfo description]);
+
+ return elementInfo;
+}
+
+
@end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index ea4db70..8cad2fc 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,14 @@
+2002-07-23 Chris Blumenberg <cblu at apple.com>
+
+ Initial plumbing for contextual menu support.
+
+ * WebCoreSupport.subproj/WebBridge.h:
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge elementInfoForMouseEvent:]): added
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView menuForEvent:]): added
+
2002-07-23 Darin Adler <darin at apple.com>
* WebKit.pbproj/project.pbxproj: Fix paths for newly added files.
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index ea4db70..8cad2fc 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,14 @@
+2002-07-23 Chris Blumenberg <cblu at apple.com>
+
+ Initial plumbing for contextual menu support.
+
+ * WebCoreSupport.subproj/WebBridge.h:
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge elementInfoForMouseEvent:]): added
+ * WebView.subproj/WebController.h:
+ * WebView.subproj/WebHTMLView.m:
+ (-[WebHTMLView menuForEvent:]): added
+
2002-07-23 Darin Adler <darin at apple.com>
* WebKit.pbproj/project.pbxproj: Fix paths for newly added files.
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.h b/WebKit/WebCoreSupport.subproj/WebBridge.h
index bbdeed0..23ead83 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.h
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.h
@@ -23,5 +23,6 @@
- (void)loadURL:(NSURL *)URL attributes:(NSDictionary *)attributes flags:(unsigned)flags withParent:(WebDataSource *)parent;
+- (NSDictionary *)elementInfoForMouseEvent:(NSEvent *)event;
@end
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index bfde907..3c8c280 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -295,4 +295,18 @@
[attributes release];
}
+- (NSDictionary *)elementInfoForMouseEvent:(NSEvent *)event
+{
+ NSDictionary *elementInfo, *elementInfoWC = [self _elementInfoForMouseEvent:event];
+
+ elementInfo = [NSDictionary dictionaryWithObjectsAndKeys:
+ [elementInfoWC objectForKey:WebCoreContextLinkURL], WebContextLinkURL,
+ [elementInfoWC objectForKey:WebCoreContextImageURL], WebContextImageURL,
+ [elementInfoWC objectForKey:WebCoreContextString], WebContextString,
+ [elementInfoWC objectForKey:WebCoreContextImage], WebContextImage,
+ [elementInfoWC objectForKey:WebCoreContextFrame], WebContextFrame, nil];
+
+ return elementInfo;
+}
+
@end
diff --git a/WebKit/WebView.subproj/WebController.h b/WebKit/WebView.subproj/WebController.h
index 78c1e91..0d0fcec 100644
--- a/WebKit/WebView.subproj/WebController.h
+++ b/WebKit/WebView.subproj/WebController.h
@@ -105,6 +105,12 @@
@end
+#define WebContextLinkURL @"WebContextLinkURL"
+#define WebContextImageURL @"WebContextImageURL"
+#define WebContextString @"WebContextString"
+#define WebContextImage @"WebContextImage"
+#define WebContextFrame @"WebContextFrame"
+
#ifdef READY_FOR_PRIME_TIME
/*
=============================================================================
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index d387fc1..aadf952 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -218,6 +218,16 @@
}
#endif
+- (NSMenu *)menuForEvent:(NSEvent *)theEvent
+{
+ //FIXME: THIS IS STILL A WORK IN PROGRESS
+ [[self _bridge] elementInfoForMouseEvent:theEvent];
+ NSMenu *menu = [[NSMenu alloc] init];
+ [menu addItemWithTitle:@"Copy" action:@selector(copy:) keyEquivalent:@""];
+ return menu;
+
+}
+
- (void)setContextMenusEnabled: (BOOL)flag
{
[NSException raise:WebMethodNotYetImplemented format:@"WebView::setContextMenusEnabled: is not implemented"];
diff --git a/WebKit/WebView.subproj/WebView.h b/WebKit/WebView.subproj/WebView.h
index 78c1e91..0d0fcec 100644
--- a/WebKit/WebView.subproj/WebView.h
+++ b/WebKit/WebView.subproj/WebView.h
@@ -105,6 +105,12 @@
@end
+#define WebContextLinkURL @"WebContextLinkURL"
+#define WebContextImageURL @"WebContextImageURL"
+#define WebContextString @"WebContextString"
+#define WebContextImage @"WebContextImage"
+#define WebContextFrame @"WebContextFrame"
+
#ifdef READY_FOR_PRIME_TIME
/*
=============================================================================
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list