FROM : Marcel Weiher
DATE : Sat Jan 11 11:24:50 2003
On Saturday, January 11, 2003, at 08:25 Uhr, Buzz Andersen wrote:
> The code below is as far as I've gotten :-). I have WebCore and
> JavaScriptCore built and successfully embedded within an application
> bundle (a la Safari), and I have experimented a bit with
> WebCoreBridge. It is clear that WebCoreBridge is what is would be
> called an abstract class in Java--that is, it is both a normal class
> that is meant to be subclassed and a protocol which specifies
> WebCoreBridge's interface to the WebCore client.
>
> My current theory is that "installInFrame:" may be the primary way to
> link up the renderer in the bowels of the KHTML/KWQ stuff with an
> actual Cocoa NSView. The following code tests this theory, but
> produces a rather disappointing result: installInFrame: calls the
> lower level QWidget::setView (love that Obj-C++ :-) and then promptly
> produces an EXC_BAD_ACCESS. Obviously there is more to setting up and
> using WebCore than is obvious through casual hacking :-(...
>
> I'd love to hear about results anyone else has had. And, if Apple is
> listening: some documentation (or even off the record hints) would be
> appreciated :-)...
Hi Buzz,
I've had (minutely) better success with doing only a minimal subclass
of WebCoreBride.
@interface WebBridge : WebCoreBridge {
}
@end
@implementation WebBridge
-(int)getObjectCacheSize
{
return 8192;
}
@end
and the following View that just tries to draw:
...
-(NSString*)demoUrl
{
return [NSString stringWithFormat:@"file://%@",[[self class]
frameworkPath:@"hi.html"]];
}
-(void)awakeFromNib
{
[self setWebBridge:[[[WebBridge alloc] init] autorelease]];
[[self webBridge] openURL:[self demoUrl] reload:YES headers:nil
lastModified:nil pageCache:nil];
}
- (void)drawRect:(NSRect)rect {
[[self webBridge] drawRect:rect];
}
This doesn't crash, and fills the View with red, so WebCore is actually
painting something, somehow (yeah!).
But it complains about missing renderers:
=================
ERROR: called KWQKHTMLPart::paint with nil renderer
(kwq/KWQKHTMLPart.mm:342 paint)
=================
and the red-filled view is not what I expect from the minimal HTML file
I was trying to render...
Marcel
--
Marcel Weiher Metaobject Software Technologies
<email_removed> www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 11 11:24:50 2003
On Saturday, January 11, 2003, at 08:25 Uhr, Buzz Andersen wrote:
> The code below is as far as I've gotten :-). I have WebCore and
> JavaScriptCore built and successfully embedded within an application
> bundle (a la Safari), and I have experimented a bit with
> WebCoreBridge. It is clear that WebCoreBridge is what is would be
> called an abstract class in Java--that is, it is both a normal class
> that is meant to be subclassed and a protocol which specifies
> WebCoreBridge's interface to the WebCore client.
>
> My current theory is that "installInFrame:" may be the primary way to
> link up the renderer in the bowels of the KHTML/KWQ stuff with an
> actual Cocoa NSView. The following code tests this theory, but
> produces a rather disappointing result: installInFrame: calls the
> lower level QWidget::setView (love that Obj-C++ :-) and then promptly
> produces an EXC_BAD_ACCESS. Obviously there is more to setting up and
> using WebCore than is obvious through casual hacking :-(...
>
> I'd love to hear about results anyone else has had. And, if Apple is
> listening: some documentation (or even off the record hints) would be
> appreciated :-)...
Hi Buzz,
I've had (minutely) better success with doing only a minimal subclass
of WebCoreBride.
@interface WebBridge : WebCoreBridge {
}
@end
@implementation WebBridge
-(int)getObjectCacheSize
{
return 8192;
}
@end
and the following View that just tries to draw:
...
-(NSString*)demoUrl
{
return [NSString stringWithFormat:@"file://%@",[[self class]
frameworkPath:@"hi.html"]];
}
-(void)awakeFromNib
{
[self setWebBridge:[[[WebBridge alloc] init] autorelease]];
[[self webBridge] openURL:[self demoUrl] reload:YES headers:nil
lastModified:nil pageCache:nil];
}
- (void)drawRect:(NSRect)rect {
[[self webBridge] drawRect:rect];
}
This doesn't crash, and fills the View with red, so WebCore is actually
painting something, somehow (yeah!).
But it complains about missing renderers:
=================
ERROR: called KWQKHTMLPart::paint with nil renderer
(kwq/KWQKHTMLPart.mm:342 paint)
=================
and the red-filled view is not what I expect from the minimal HTML file
I was trying to render...
Marcel
--
Marcel Weiher Metaobject Software Technologies
<email_removed> www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Philippe Mougin | Jan 8, 20:52 | |
| John Siracusa | Jan 8, 22:18 | |
| John Siracusa | Jan 8, 22:26 | |
| Philippe Mougin | Jan 8, 22:29 | |
| Greg Titus | Jan 9, 01:01 | |
| Philippe Mougin | Jan 9, 02:13 | |
| Owen Anderson | Jan 9, 05:04 | |
| Marcel Weiher | Jan 11, 02:07 | |
| Buzz Andersen | Jan 11, 08:25 | |
| Marcel Weiher | Jan 11, 11:24 | |
| Phillip Mills | Jan 11, 13:21 | |
| Marcel Weiher | Jan 11, 13:43 | |
| Adam Atlas | Jan 11, 15:53 | |
| Marcel Weiher | Jan 12, 13:59 | |
| Kazutoshi Kubota | Jan 12, 17:25 | |
| Phillip Mills | Jan 12, 18:19 | |
| Finlay Dobbie | Jan 12, 18:47 | |
| Buzz Andersen | Jan 12, 22:38 | |
| Robert Nicholson | Jan 13, 17:03 | |
| Kazutoshi Kubota | Jan 13, 17:35 | |
| Phillip Mills | Jan 13, 18:52 |






Cocoa mail archive

