[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:17:57 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d77ed6c8205cd14b291bf40755587d62cd3c2c35
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jun 11 20:50:10 2002 +0000
WebKit:
* WebView.subproj/IFDOMNode.h: Added.
* WebView.subproj/IFDOMNode.mm: Added.
* WebView.subproj/IFRenderNode.h: Added.
* WebView.subproj/IFRenderNode.mm: Added.
These contain all the interesting bits of the code for the render
and DOM tree viewers, mostly moved here from WebBrowser.
* WebView.subproj/IFWebViewPrivate.mm: Remove the methods in here that
aren't declared in the header and are only used for the render and DOM
tree viewers.
* WebKit.pbproj/project.pbxproj: Add new files.
WebBrowser:
Removed all C and Objective C++, making this all Objective C again, which
helps make build times faster.
* ___CFA2UC.c: Removed.
* WebBrowserPrefix.h: Removed code to handle non-Objective C, and also
removed <config.h>.
* Debug/DOMTree.m: Renamed from DOMTree.mm. Also changed to use IFDOMNode
from WebKit for all the interesting bits.
* Debug/DOMTree.mm: Renamed to DOMTree.m.
* Debug/DOMTree.h: Put dataSource in object as a step toward making this not
leak some day.
* Debug/RenderTree.m: Renamed from RenderTree.mm. Also changed to use
IFRenderNode from WebKit for all the interesting bits.
* Debug/RenderTree.mm: Renamed to RenderTree.m.
* Debug/RenderTree.h: Put dataSource in object as a step toward making this
not leak some day.
* WebBrowser.pbproj/project.pbxproj: Change files around. Add warnings that
weren't allowed in C++; this project is now all Objective C. Remove C and
Objective C++ from PFE dialects list. Remove header search paths.
* main.m: Use "../config.h" to get at config.h. In the long run, we can
just get rid of this.
* Debug/DebugUtilities.m: Unimportant tweaks.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 1b08f06..7f763a1 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,18 @@
+2002-06-11 Darin Adler <darin at apple.com>
+
+ * WebView.subproj/IFDOMNode.h: Added.
+ * WebView.subproj/IFDOMNode.mm: Added.
+ * WebView.subproj/IFRenderNode.h: Added.
+ * WebView.subproj/IFRenderNode.mm: Added.
+ These contain all the interesting bits of the code for the render
+ and DOM tree viewers, mostly moved here from WebBrowser.
+
+ * WebView.subproj/IFWebViewPrivate.mm: Remove the methods in here that
+ aren't declared in the header and are only used for the render and DOM
+ tree viewers.
+
+ * WebKit.pbproj/project.pbxproj: Add new files.
+
2002-06-10 Darin Adler <darin at apple.com>
* Makefile.am: Do a clean before building if the force-clean-timestamp file is
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 1b08f06..7f763a1 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,18 @@
+2002-06-11 Darin Adler <darin at apple.com>
+
+ * WebView.subproj/IFDOMNode.h: Added.
+ * WebView.subproj/IFDOMNode.mm: Added.
+ * WebView.subproj/IFRenderNode.h: Added.
+ * WebView.subproj/IFRenderNode.mm: Added.
+ These contain all the interesting bits of the code for the render
+ and DOM tree viewers, mostly moved here from WebBrowser.
+
+ * WebView.subproj/IFWebViewPrivate.mm: Remove the methods in here that
+ aren't declared in the header and are only used for the render and DOM
+ tree viewers.
+
+ * WebKit.pbproj/project.pbxproj: Add new files.
+
2002-06-10 Darin Adler <darin at apple.com>
* Makefile.am: Do a clean before building if the force-clean-timestamp file is
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 2ead55a..1359b13 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -244,6 +244,8 @@
9CE1F8A402A5C6F30ECA2ACD,
9CE1F8A602A5C6F30ECA2ACD,
F59668CA02AD2923018635CA,
+ F5F81C3702B67C0F018635CA,
+ F5F81C3B02B67C26018635CA,
);
isa = PBXHeadersBuildPhase;
};
@@ -310,6 +312,8 @@
9CE1F8A502A5C6F30ECA2ACD,
9CE1F8A702A5C6F30ECA2ACD,
F59668CB02AD2923018635CA,
+ F5F81C3802B67C0F018635CA,
+ F5F81C3C02B67C26018635CA,
);
isa = PBXSourcesBuildPhase;
};
@@ -989,6 +993,10 @@
F5D538EC02441FDD01A80181,
9CAE9D070252A4130ECA16EA,
F567433E026B5B7B01A80181,
+ F5F81C3502B67C0F018635CA,
+ F5F81C3602B67C0F018635CA,
+ F5F81C3902B67C26018635CA,
+ F5F81C3A02B67C26018635CA,
);
isa = PBXGroup;
name = WebView;
@@ -1947,6 +1955,60 @@
settings = {
};
};
+ F5F81C3502B67C0F018635CA = {
+ isa = PBXFileReference;
+ name = IFDOMNode.h;
+ path = WebView.subproj/IFDOMNode.h;
+ refType = 4;
+ };
+ F5F81C3602B67C0F018635CA = {
+ isa = PBXFileReference;
+ name = IFDOMNode.mm;
+ path = WebView.subproj/IFDOMNode.mm;
+ refType = 4;
+ };
+ F5F81C3702B67C0F018635CA = {
+ fileRef = F5F81C3502B67C0F018635CA;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F5F81C3802B67C0F018635CA = {
+ fileRef = F5F81C3602B67C0F018635CA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5F81C3902B67C26018635CA = {
+ isa = PBXFileReference;
+ name = IFRenderNode.h;
+ path = WebView.subproj/IFRenderNode.h;
+ refType = 4;
+ };
+ F5F81C3A02B67C26018635CA = {
+ isa = PBXFileReference;
+ name = IFRenderNode.mm;
+ path = WebView.subproj/IFRenderNode.mm;
+ refType = 4;
+ };
+ F5F81C3B02B67C26018635CA = {
+ fileRef = F5F81C3902B67C26018635CA;
+ isa = PBXBuildFile;
+ settings = {
+ ATTRIBUTES = (
+ Private,
+ );
+ };
+ };
+ F5F81C3C02B67C26018635CA = {
+ fileRef = F5F81C3A02B67C26018635CA;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
//F50
//F51
//F52
diff --git a/WebKit/WebView.subproj/IFDOMNode.h b/WebKit/WebView.subproj/IFDOMNode.h
new file mode 100644
index 0000000..fb0cee4
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDOMNode.h
@@ -0,0 +1,28 @@
+//
+// IFDOMNode.h
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at class IFWebView;
+
+ at interface IFDOMNode : NSObject
+{
+ NSArray *children;
+ NSString *name;
+ NSString *value;
+ NSString *source;
+}
+
+- initWithWebView:(IFWebView *)view;
+
+- (NSArray *)children;
+- (NSString *)name;
+- (NSString *)value;
+- (NSString *)source;
+
+ at end
diff --git a/WebKit/WebView.subproj/IFDOMNode.mm b/WebKit/WebView.subproj/IFDOMNode.mm
new file mode 100644
index 0000000..5ca1c90
--- /dev/null
+++ b/WebKit/WebView.subproj/IFDOMNode.mm
@@ -0,0 +1,71 @@
+//
+// IFDOMNode.m
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "IFDOMNode.h"
+
+#import <WebKit/IFWebViewPrivate.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
+#import <xml/dom_docimpl.h>
+
+ at implementation IFDOMNode
+
+- initWithDOMNode:(DOM::NodeImpl *)node
+{
+ NSMutableArray *collectChildren;
+
+ [super init];
+
+ collectChildren = [NSMutableArray array];
+
+ name = [node->nodeName().string().getNSString() copy];
+ value = [node->nodeValue().string().getNSString() copy];
+ source = [node->recursive_toHTML(1).getNSString() copy];
+
+ for (DOM::NodeImpl *child = node->firstChild(); child; child->nextSibling())
+ [collectChildren addObject:[[[IFDOMNode alloc] initWithDOMNode: child] autorelease]];
+
+ children = [collectChildren copy];
+
+ return self;
+}
+
+- initWithWebView:(IFWebView *)view
+{
+ return [self initWithDOMNode:[view _widget]->part()->xmlDocImpl()];
+}
+
+- (void)dealloc
+{
+ [name release];
+ [value release];
+ [source release];
+ [children release];
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)value
+{
+ return value;
+}
+
+- (NSString *)source
+{
+ return source;
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/IFRenderNode.h b/WebKit/WebView.subproj/IFRenderNode.h
new file mode 100644
index 0000000..2c64132
--- /dev/null
+++ b/WebKit/WebView.subproj/IFRenderNode.h
@@ -0,0 +1,31 @@
+//
+// IFRenderNode.h
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at class IFWebView;
+
+ at interface IFRenderNode : NSObject
+{
+ NSArray *children;
+ int x, y;
+ int width;
+ int height;
+ NSString *name;
+}
+
+- initWithWebView:(IFWebView *)view;
+
+- (NSArray *)children;
+
+- (NSString *)positionString;
+- (NSString *)widthString;
+- (NSString *)heightString;
+- (NSString *)name;
+
+ at end
diff --git a/WebKit/WebView.subproj/IFRenderNode.mm b/WebKit/WebView.subproj/IFRenderNode.mm
new file mode 100644
index 0000000..f5010b0
--- /dev/null
+++ b/WebKit/WebView.subproj/IFRenderNode.mm
@@ -0,0 +1,91 @@
+//
+// IFRenderNode.m
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "IFRenderNode.h"
+
+#import <IFWebViewPrivate.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
+#import <xml/dom_docimpl.h>
+#import <rendering/render_frames.h>
+
+ at implementation IFRenderNode
+
+- initWithRenderObject:(khtml::RenderObject *)node
+{
+ NSMutableArray *collectChildren;
+
+ [super init];
+
+ collectChildren = [NSMutableArray array];
+
+ name = [[NSString stringWithCString:node->renderName()] retain];
+ x = node->xPos();
+ y = node->yPos();
+ width = node->width();
+ height = node->height();
+
+ for (khtml::RenderObject *child = node->firstChild(); child; child = child->nextSibling()) {
+ [collectChildren addObject:[[[IFRenderNode alloc] initWithRenderObject: child] autorelease]];
+ }
+
+ khtml::RenderPart *part = dynamic_cast<khtml::RenderPart *>(node);
+ if (part) {
+ NSView *view = part->widget()->getView();
+ if ([view isKindOfClass:[NSScrollView class]]) {
+ NSScrollView *scrollView = (NSScrollView *)view;
+ view = [scrollView documentView];
+ }
+ if ([view isKindOfClass:[IFWebView class]]) {
+ IFWebView *webView = (IFWebView *)view;
+ [collectChildren addObject:[[[IFRenderNode alloc] initWithWebView:webView] autorelease]];
+ }
+ }
+
+ children = [collectChildren copy];
+
+ return self;
+}
+
+- initWithWebView:(IFWebView *)view
+{
+ return [self initWithRenderObject:[view _widget]->part()->xmlDocImpl()->renderer()];
+}
+
+- (void)dealloc
+{
+ [name release];
+ [children release];
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)positionString
+{
+ return [NSString stringWithFormat:@"(%d, %d)", x, y];
+}
+
+- (NSString *)widthString
+{
+ return [NSString stringWithFormat:@"%d", width];
+}
+
+- (NSString *)heightString
+{
+ return [NSString stringWithFormat:@"%d", height];
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/IFWebViewPrivate.mm b/WebKit/WebView.subproj/IFWebViewPrivate.mm
index ca8031f..eee7488 100644
--- a/WebKit/WebView.subproj/IFWebViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFWebViewPrivate.mm
@@ -74,45 +74,6 @@
return _private->widget;
}
-- (DOM::DocumentImpl *)_document
-{
- KHTMLPart *part = _private->widget->part();
- if (part) {
- return part->xmlDocImpl();
- }
- return 0;
-}
-
-+ (NSString *)_nodeName: (DOM::NodeImpl *)node
-{
- // FIXME: good for debugging only since it's Latin 1 only
- return [NSString stringWithCString:node->nodeName().string().latin1()];
-}
-
-+ (NSString *)_nodeValue: (DOM::NodeImpl *)node
-{
- // FIXME: good for debugging only since it's Latin 1 only
- return [NSString stringWithCString:node->nodeValue().string().latin1()];
-}
-
-+ (NSString *)_nodeHTML: (DOM::NodeImpl *)node
-{
- NSString *string = QSTRING_TO_NSSTRING(node->recursive_toHTML(1));
- return string;
-}
-
-- (khtml::RenderObject *)_renderRoot
-{
- KHTMLPart *part = _private->widget->part();
- DOM::DocumentImpl *doc;
- if (part) {
- doc = part->xmlDocImpl();
- if (doc)
- return doc->renderer();
- }
- return 0;
-}
-
- (KHTMLView *)_provisionalWidget
{
return _private->provisionalWidget;
diff --git a/WebKit/WebView.subproj/WebDOMNode.h b/WebKit/WebView.subproj/WebDOMNode.h
new file mode 100644
index 0000000..fb0cee4
--- /dev/null
+++ b/WebKit/WebView.subproj/WebDOMNode.h
@@ -0,0 +1,28 @@
+//
+// IFDOMNode.h
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at class IFWebView;
+
+ at interface IFDOMNode : NSObject
+{
+ NSArray *children;
+ NSString *name;
+ NSString *value;
+ NSString *source;
+}
+
+- initWithWebView:(IFWebView *)view;
+
+- (NSArray *)children;
+- (NSString *)name;
+- (NSString *)value;
+- (NSString *)source;
+
+ at end
diff --git a/WebKit/WebView.subproj/WebDOMNode.m b/WebKit/WebView.subproj/WebDOMNode.m
new file mode 100644
index 0000000..5ca1c90
--- /dev/null
+++ b/WebKit/WebView.subproj/WebDOMNode.m
@@ -0,0 +1,71 @@
+//
+// IFDOMNode.m
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "IFDOMNode.h"
+
+#import <WebKit/IFWebViewPrivate.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
+#import <xml/dom_docimpl.h>
+
+ at implementation IFDOMNode
+
+- initWithDOMNode:(DOM::NodeImpl *)node
+{
+ NSMutableArray *collectChildren;
+
+ [super init];
+
+ collectChildren = [NSMutableArray array];
+
+ name = [node->nodeName().string().getNSString() copy];
+ value = [node->nodeValue().string().getNSString() copy];
+ source = [node->recursive_toHTML(1).getNSString() copy];
+
+ for (DOM::NodeImpl *child = node->firstChild(); child; child->nextSibling())
+ [collectChildren addObject:[[[IFDOMNode alloc] initWithDOMNode: child] autorelease]];
+
+ children = [collectChildren copy];
+
+ return self;
+}
+
+- initWithWebView:(IFWebView *)view
+{
+ return [self initWithDOMNode:[view _widget]->part()->xmlDocImpl()];
+}
+
+- (void)dealloc
+{
+ [name release];
+ [value release];
+ [source release];
+ [children release];
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)value
+{
+ return value;
+}
+
+- (NSString *)source
+{
+ return source;
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebDebugDOMNode.h b/WebKit/WebView.subproj/WebDebugDOMNode.h
new file mode 100644
index 0000000..fb0cee4
--- /dev/null
+++ b/WebKit/WebView.subproj/WebDebugDOMNode.h
@@ -0,0 +1,28 @@
+//
+// IFDOMNode.h
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at class IFWebView;
+
+ at interface IFDOMNode : NSObject
+{
+ NSArray *children;
+ NSString *name;
+ NSString *value;
+ NSString *source;
+}
+
+- initWithWebView:(IFWebView *)view;
+
+- (NSArray *)children;
+- (NSString *)name;
+- (NSString *)value;
+- (NSString *)source;
+
+ at end
diff --git a/WebKit/WebView.subproj/WebDebugDOMNode.m b/WebKit/WebView.subproj/WebDebugDOMNode.m
new file mode 100644
index 0000000..5ca1c90
--- /dev/null
+++ b/WebKit/WebView.subproj/WebDebugDOMNode.m
@@ -0,0 +1,71 @@
+//
+// IFDOMNode.m
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "IFDOMNode.h"
+
+#import <WebKit/IFWebViewPrivate.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
+#import <xml/dom_docimpl.h>
+
+ at implementation IFDOMNode
+
+- initWithDOMNode:(DOM::NodeImpl *)node
+{
+ NSMutableArray *collectChildren;
+
+ [super init];
+
+ collectChildren = [NSMutableArray array];
+
+ name = [node->nodeName().string().getNSString() copy];
+ value = [node->nodeValue().string().getNSString() copy];
+ source = [node->recursive_toHTML(1).getNSString() copy];
+
+ for (DOM::NodeImpl *child = node->firstChild(); child; child->nextSibling())
+ [collectChildren addObject:[[[IFDOMNode alloc] initWithDOMNode: child] autorelease]];
+
+ children = [collectChildren copy];
+
+ return self;
+}
+
+- initWithWebView:(IFWebView *)view
+{
+ return [self initWithDOMNode:[view _widget]->part()->xmlDocImpl()];
+}
+
+- (void)dealloc
+{
+ [name release];
+ [value release];
+ [source release];
+ [children release];
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)value
+{
+ return value;
+}
+
+- (NSString *)source
+{
+ return source;
+}
+
+ at end
diff --git a/WebKit/WebView.subproj/WebFrameViewPrivate.m b/WebKit/WebView.subproj/WebFrameViewPrivate.m
index ca8031f..eee7488 100644
--- a/WebKit/WebView.subproj/WebFrameViewPrivate.m
+++ b/WebKit/WebView.subproj/WebFrameViewPrivate.m
@@ -74,45 +74,6 @@
return _private->widget;
}
-- (DOM::DocumentImpl *)_document
-{
- KHTMLPart *part = _private->widget->part();
- if (part) {
- return part->xmlDocImpl();
- }
- return 0;
-}
-
-+ (NSString *)_nodeName: (DOM::NodeImpl *)node
-{
- // FIXME: good for debugging only since it's Latin 1 only
- return [NSString stringWithCString:node->nodeName().string().latin1()];
-}
-
-+ (NSString *)_nodeValue: (DOM::NodeImpl *)node
-{
- // FIXME: good for debugging only since it's Latin 1 only
- return [NSString stringWithCString:node->nodeValue().string().latin1()];
-}
-
-+ (NSString *)_nodeHTML: (DOM::NodeImpl *)node
-{
- NSString *string = QSTRING_TO_NSSTRING(node->recursive_toHTML(1));
- return string;
-}
-
-- (khtml::RenderObject *)_renderRoot
-{
- KHTMLPart *part = _private->widget->part();
- DOM::DocumentImpl *doc;
- if (part) {
- doc = part->xmlDocImpl();
- if (doc)
- return doc->renderer();
- }
- return 0;
-}
-
- (KHTMLView *)_provisionalWidget
{
return _private->provisionalWidget;
diff --git a/WebKit/WebView.subproj/WebRenderNode.h b/WebKit/WebView.subproj/WebRenderNode.h
new file mode 100644
index 0000000..2c64132
--- /dev/null
+++ b/WebKit/WebView.subproj/WebRenderNode.h
@@ -0,0 +1,31 @@
+//
+// IFRenderNode.h
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+ at class IFWebView;
+
+ at interface IFRenderNode : NSObject
+{
+ NSArray *children;
+ int x, y;
+ int width;
+ int height;
+ NSString *name;
+}
+
+- initWithWebView:(IFWebView *)view;
+
+- (NSArray *)children;
+
+- (NSString *)positionString;
+- (NSString *)widthString;
+- (NSString *)heightString;
+- (NSString *)name;
+
+ at end
diff --git a/WebKit/WebView.subproj/WebRenderNode.m b/WebKit/WebView.subproj/WebRenderNode.m
new file mode 100644
index 0000000..f5010b0
--- /dev/null
+++ b/WebKit/WebView.subproj/WebRenderNode.m
@@ -0,0 +1,91 @@
+//
+// IFRenderNode.m
+// WebKit
+//
+// Created by Darin Adler on Tue Jun 11 2002.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
+//
+
+#import "IFRenderNode.h"
+
+#import <IFWebViewPrivate.h>
+#import <khtmlview.h>
+#import <khtml_part.h>
+#import <xml/dom_docimpl.h>
+#import <rendering/render_frames.h>
+
+ at implementation IFRenderNode
+
+- initWithRenderObject:(khtml::RenderObject *)node
+{
+ NSMutableArray *collectChildren;
+
+ [super init];
+
+ collectChildren = [NSMutableArray array];
+
+ name = [[NSString stringWithCString:node->renderName()] retain];
+ x = node->xPos();
+ y = node->yPos();
+ width = node->width();
+ height = node->height();
+
+ for (khtml::RenderObject *child = node->firstChild(); child; child = child->nextSibling()) {
+ [collectChildren addObject:[[[IFRenderNode alloc] initWithRenderObject: child] autorelease]];
+ }
+
+ khtml::RenderPart *part = dynamic_cast<khtml::RenderPart *>(node);
+ if (part) {
+ NSView *view = part->widget()->getView();
+ if ([view isKindOfClass:[NSScrollView class]]) {
+ NSScrollView *scrollView = (NSScrollView *)view;
+ view = [scrollView documentView];
+ }
+ if ([view isKindOfClass:[IFWebView class]]) {
+ IFWebView *webView = (IFWebView *)view;
+ [collectChildren addObject:[[[IFRenderNode alloc] initWithWebView:webView] autorelease]];
+ }
+ }
+
+ children = [collectChildren copy];
+
+ return self;
+}
+
+- initWithWebView:(IFWebView *)view
+{
+ return [self initWithRenderObject:[view _widget]->part()->xmlDocImpl()->renderer()];
+}
+
+- (void)dealloc
+{
+ [name release];
+ [children release];
+}
+
+- (NSArray *)children
+{
+ return children;
+}
+
+- (NSString *)name
+{
+ return name;
+}
+
+- (NSString *)positionString
+{
+ return [NSString stringWithFormat:@"(%d, %d)", x, y];
+}
+
+- (NSString *)widthString
+{
+ return [NSString stringWithFormat:@"%d", width];
+}
+
+- (NSString *)heightString
+{
+ return [NSString stringWithFormat:@"%d", height];
+}
+
+ at end
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list