mazilla mozilla
What's mozilla
Purpose of this page
Characteristics of mozilla
Survey of mozilla
Web tool
Technology of mozilla
Other resource
Building mozilla
Construction of environment
for building
Checkout of source
Procedure for building
Image of after-building
Execute mozilla
What's embedding
Concept of embedding
Structure of PPBrowser
Analysis of PPBrowser
Structure of embedding
Structure of marbrow
Analysis of marbrow
What's fizzilla
Build fizzilla
Embedding of fizzilla
Talk with Mr. Yatsugi

Structure of PPBrowser

How is PPBrowser!?

Mozilla has Mr. Conrad Carlen's PPBrowser as a model of embedding on Macintosh.

On this section, I analyze PPBrowser and probe structure of mozilla embedding.


Source code is contained in mozilla source itself and already checked out.


You can build it by the following CodeWarrior project.


The executables of building results are outputted in the following places.

mozilla/dist/viewer/PP Browser
mozilla/dist/viewer_debug/PP BrowserDebug

[Screen shot of PPBrowser]

Source tree structure


CBrowserApp.cp - Application class (CBrowserApp)
CBrowserShell.cpp - BrowserShell class (CBrowserShell)
CBrowserWindow.cp - Window class (CBrowserWindow)
CFindComponent.cpp - Find Component class (CFindComponent)
CThrobber.cpp - Throbber class (CThrobber)
CUrlField.cp - Url Field class (CUrlField)
CWebBrowserChrome.cpp - Browser chrome class (CWebBrowserChrome)
UMacUnicode.cpp - Unicode conversion utility
Browser.ppob - PowerPlant Object resource
Browser.rsrc - Other resource
cfmAlias.rsrc - Alias resource for Release Building [#1]
cfmAliasDebug.rsrc - Alias resource for Debug Building [#1]

Embed API [#2]

EmbedAPI.mcp - Project for Embedding Library
EmbedAPI.o - Embedding Library for Release Building
EmbedAPIDebug.o - Embedding Library for Debug Building

PowerPlant Resources
PowerPlant Appearance

Source & resource for PowerPlant classes which are used.

System Libraries

Stub libraries for Macintosh Shlbs which are used.

NS Libraries - Library for mozilla (Common to Release & Debug)

NSAppStartup.o - Startup code for mozilla (mozilla/dist/mac/lib/) [#3]

NS Libraries/Release - Library for mozilla (For Release) [#4]

appfilelocprovider.o - (mozilla/modules/appfilelocprovider/)
mpfilelocprovider.o - (mozilla/modules/mpfilelocprovider/)
gfx.shlb - (mozilla/dist/viewer/Essential Files/)
NSRuntime.shlb- (mozilla/dist/viewer/Essential Files/)
NSStdLib.shlb- (mozilla/dist/viewer/Essential Files/)
NSPR20.shlb- (mozilla/dist/viewer/Essential Files/)
RaptorShell.shlb- (mozilla/dist/viewer/Essential Files/)
widget.shlb- (mozilla/dist/viewer/Essential Files/)
xpcom.shlb- (mozilla/dist/viewer/Essential Files/)

NS Libraries/Release - Library for mozilla (For Debug) [#4]

appfilelocproviderDebug.o - (mozilla/modules/appfilelocprovider/)
mpfilelocproviderDebug.o - (mozilla/modules/mpfilelocprovider/)
gfxDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
NSRuntimeDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
NSStdLibDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
NSPR20Debug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
RaptorShellDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
widgetDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)
xpcomDebug.shlb - (mozilla/dist/viewer_debug/Essential Files/)


cfmAlias.rsrc or cfmAliasDebug.rsrc contains the alias resource which specifies the path of Shlbs that the mozilla executable uses.

  • cfmAlias.rsrc - resType = 'alis'、resID = 129
  • cfmAliasDebug.rsrc - resType = 'alis'、resID = 128

By specifing these alias resource ID's in Library Folder ID: of PPC PEF Setting, relative path of Shlb can be used.


Embedding Libraries (EmbedAPI.o, EmbedAPIDebug.o) is not created when the build of mozilla itself. After the mozilla build, you can build them by mozilla/embedding/base/macbuild/EmbedAPI.mcp project. PPBrowser project includes this EmbedAPI.mcp as a subproject and can outputs Embedding Libraries. What you need actually are EmbedAPI.o, EmbedAPIDebug.o.


Mozilla uses the original startup code.
In addition to normal startup function, Initialization/temination of GC (Garbege Collector) is added.


Link this, and in PPC Linker Setting, set Initialization: to __NSInitialize, Termination: to __NSTerminate.


Among of these things, Shlbs are not linked actually, but only used for checking the reference resolving. Shlbs used in mozilla exist in

  • mozilla/dist/viewer/Essential Files/ - Essential Shlb for Release
  • mozilla/dist/viewer/Components/ - Component Shlb for Release
  • mozilla/dist/viewer_debug/Essential Files/ - Essential Shlb for Debug
  • mozilla/dist/viewer_debug/Components/ - Component Shlb for Debug

But these are aliases and their entities exist under the directories of each module.

The directory mozilla/dist/viewer/ contains complete execution environment of mozilla, but it includes a lot of aliases such as Shlbs. Therefore, when you dare to make your program a product, you must resolve these aliases by entities.

Visual structure

Because PPBrowser is PowerPlant application, visual structure of main window is defined statically in Layout resource (ID=129) of Browser.ppob

Layout of main window in Constructor is like this.

I show the important elements among these below.

  ( class_ID='BroW', class=CBrowserWindow )

Main window.

  ( class_ID='BroS', pain_ID='WebS'、class=CBrowserShell )

Browser control (HTML part).

  ( class_ID='UrlF', pain_ID='gUrl'、class=CUrlField )

URL control (LocationBar).

  ( class_ID='UrlF', pain_ID='Stat'、class=LStaticText )

Status control.

  ( class_ID='bbut', pain_ID='Back'、class=LBevelButton )

  ( class_ID='bbut', pain_ID='Forw'、class=LBevelButton )

  ( class_ID='bbut', pain_ID='Stop'、class=LBevelButton )

Back, Forward, Stop button.

  ( class_ID='pbar', pain_ID='Prog'、class=LProgressBar )

Progress bar control

  ( class_ID='Thrb', pain_ID='THRB'、class=CThrobber )

Throbber control (animated picture on net process)

Class structure

CBrowserApp (CBrowserApp.cp、CBrowserApp.h)

Class of applications.

CBrowserWindow (CBrowserWindow.cp、CBrowserWindow.h)

Class of main window.

CBrowserShell (CBrowserShell.cp、CBrowserShell.h)

Class of browser control (HTML part).

CWebBrowserChrome (CWebBrowserChrome.cp、CWebBrowserChrome.h)

Class of browser chrome. By owning necessary interfaces and being in close cooperation with browser control, this works as relay station between browser control class and mozilla browser itself.

CUrlField (CUrlField.cp、CUrlField.h)

Class of URL control (LocationBar).

CThrobber (CThrobber.cp、CThrobber.h)

Class of throbber control (animated picture on net process).

CFindComponent (CFindComponent.cp、CFindComponent.h)

Class of Find Component.

Moreover, there are some classes that has been implemented as existing PowerPlant classes.

  • Back, Forward, Stop button - LBevelButton
  • Status bar - LStaticText
  • Progress bar - LProgressBar

Copyright (C) 2000-2002 Symphony, Inc. All Rights Reserved.