CHBrowserViewby Mike Pinkerton |
Goals:
- Provide a Cocoa NSView for embeddors - this is done with CHBrowserView.
- Native widgets - a native Cocoa app is going to want native widgetry
- Buildable from ProjectBuilder - we will provide a Cocoa framework for Gecko
Topics:
- Building
- Embedding
Building
To build the standalone mozilla with the Cocoa widget library:
1. Follow the instructions on the FizzillaMach build page for setup, pulling and building. |
2. Create a file called .mozconfig in your mozilla directory. In it, put the following line ac_add_options --enable-default-toolkit=cocoa |
3. Configure, and build again. This will replace the Carbon widget implementation with Cocoa. % ./configure % make -f client.mk build |
Once you've done that, things get more interesting. We next move to building the embedded test app for Cocoa.
1. Build embed.jar
|
2. Build the mozilla framework for embedding with ProjectBuilder. Note that this is a ProjectBuilder 2.0 project and may not work in ProjectBuilder 1.x on OSX 10.1.5
|
3. Enjoy! |
Embedding
<More to come on how this actually works>
There are three parts to the Cocoa effort:
- Widget/GFX impemented in Cocoa
- An CHBrowserView that subclasses NSView and wraps all of Gecko
- The Cocoa-based embedding application
Currently, only the widget library has been ported to Cocoa, and not yet all of it. It works pretty well for embedded applications (like Camino). If you'd like to work on it, the code lives in mozilla/widget/src/cocoa.
The CHBrowserView lives in mozilla/embedding/browser/cocoa/src/. It's a good place to look at what it takes to wrap all of the embedding interfaces Gecko implements.
Our test harness for embedding the CHBrowserView lives in mozilla/embedding/tests/cocoaEmbed. It's a good place to learn about how to utilize an CHBrowserView in a real-world application.
What If It Doesn't Work?
There are two places to go for help building Fizzilla:
- the #mozilla channel at irc.mozilla.org is a good place to find some mac weenies in real time who, if you ask nicely and don't be a pest, will happily get you on your way
- post to the newsgroup netscape.public.mozilla.macosx
written by Mike Pinkerton (pinkerton@netscape.com)