Skip navigation.
 
mlRe: Notes about WebCore
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.

Related mailsAuthorDate
mlNotes about WebCore Philippe Mougin Jan 8, 20:52
mlRe: Notes about WebCore John Siracusa Jan 8, 22:18
mlRe: Notes about WebCore John Siracusa Jan 8, 22:26
mlNotes about WebCore Philippe Mougin Jan 8, 22:29
mlRe: Notes about WebCore Greg Titus Jan 9, 01:01
mlRe: Notes about WebCore Philippe Mougin Jan 9, 02:13
mlRe: Notes about WebCore Owen Anderson Jan 9, 05:04
mlRe: Notes about WebCore Marcel Weiher Jan 11, 02:07
mlRe: Notes about WebCore Buzz Andersen Jan 11, 08:25
mlRe: Notes about WebCore Marcel Weiher Jan 11, 11:24
mlRe: Notes about WebCore Phillip Mills Jan 11, 13:21
mlRe: Notes about WebCore Marcel Weiher Jan 11, 13:43
mlRe: Notes about WebCore Adam Atlas Jan 11, 15:53
mlRe: Notes about WebCore Marcel Weiher Jan 12, 13:59
mlRe: Notes about WebCore Kazutoshi Kubota Jan 12, 17:25
mlRe: Notes about WebCore Phillip Mills Jan 12, 18:19
mlRe: Notes about WebCore Finlay Dobbie Jan 12, 18:47
mlRe: Notes about WebCore Buzz Andersen Jan 12, 22:38
mlRe: Notes about WebCore Robert Nicholson Jan 13, 17:03
mlRe: Notes about WebCore Kazutoshi Kubota Jan 13, 17:35
mlRe: Notes about WebCore Phillip Mills Jan 13, 18:52