• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Notes about WebCore
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notes about WebCore


  • Subject: Re: Notes about WebCore
  • From: Marcel Weiher <email@hidden>
  • Date: Sat, 11 Jan 2003 11:24:50 +0100

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@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Notes about WebCore (From: Buzz Andersen <email@hidden>)

  • Prev by Date: Apple and Cocoa (why don't they eat their own dog food?)
  • Next by Date: Re: Apple and Cocoa (why don't they eat their own dog food?)
  • Previous by thread: Re: Notes about WebCore
  • Next by thread: Re: Notes about WebCore
  • Index(es):
    • Date
    • Thread