Mozilla Source Code Directory Structure
出典: MDC
The code for all projects in the Mozilla family (such as Firefox, Thunderbird, etc.) is combined into a single source tree. The tree contains the source code as well as the code required to build each project on supported platforms (Linux, Windows, Mac OS, etc).
To simply take a look at the Mozilla source code, you do not need to download it. You can look at the source directly with your web browser using LXR (start at http://lxr.mozilla.org/mozilla/source/ for the complete mozilla source code of branch HEAD).
In order to modify the source, you have to acquire it by either downloading a snapshot of the sources or by checking out the current sources from CVS.
This document describes the directory structure that can be pulled by client.mk -- i.e., directories that are used by at least some of the Mozilla project's client products. There are other directories in the Mozilla CVS repository, such as those for Web tools and those for the Classic codebase.
See source code directories overview for a somewhat different version of the same information.
[編集] accessible
Files for accessibility (i.e. MSAA (Microsoft Active Accessibility), ATK (Accessibility Toolkit, used by GTK+ 2) support files). See Mozilla Accessibility.
[編集] browser
Contains the front end code (in XUL, Javascript, XBL, and C++) for the Firefox browser. Many of these files started off as a copy of files in xpfe/.
[編集] build
Miscellaneous files used by the build process. See also config/.
[編集] calendar
Implementation of the Calendar, originally created by OEone. See also extensions/lightning/.
[編集] caps
Capability-based web page security management.
caps contains C++ interfaces and code for determining the capabilities of content based on the security settings or certificates (e.g. VeriSign). See Component Security.
[編集] chrome
Chrome registry used with toolkit/. These files were originally copies of files in rdf/chrome/.
[編集] composer
The front end code (XUL and Javascript) for the standalone composer application.
[編集] config
More files used by the build process, common includes for the makefiles, etc. See also build/.
[編集] content
The data structures that represent the structure of Web pages (documents, elements, text nodes, etc.). These objects contain the implementation of many DOM interfaces and also implement some behaviors associated with those objects, such as link handling, form control behavior and form submission.
This directory also contains the code for XUL templates, XBL, XSLT, XTF, and other related standards.
[編集] db
Container for database-accessing modules. Currently contains mork and sqlite.
[編集] db/mdb and db/mork
Implementation of Mork, a textual format for databases. Used for example to store the global history.
[編集] db/sqlite3
The SQLite database, used by storage. Planned to supersede mork.
[編集] dbm
Source code of the berkeley database library, hacked from the 4.4BSD version. Used mainly by NSS code as certificate store.
[編集] directory
LDAP support for Mozilla. Used in mailnews.
[編集] docshell
Implementation of the docshell, the main object managing things related to a document window. Each frame has its own docshell. Contains methods for loading URIs, managing URI content listeners, etc. It is the outermost layer of the embedding API used to embed a Gecko browser into an application. See also webshell/.
[編集] dom
Contains:
- IDL definitions of the interfaces defined by the DOM specifications and Mozilla extensions to those interfaces (implementations of these interfaces are primarily, but not completely, in content/).
- The parts of the connection between JavaScript and the implementations of DOM objects that are specific both to JavaScript and to the DOM. (The parts that are not DOM-specific, i.e., the generic binding between XPCOM and Javascript, live in xpconnect/.)
- Implementations of a few of the core "DOM Level 0" objects, such as window, navigator, location, etc.
[編集] editor
Contains:
- The backend for HTML and text editing. This is not only used for the mail composer and the page editor composer, but also for rich text editing inside webpages. Textarea and input fields are using such an editor as well (in the plaintext variant). See Mozilla Editor.
- The frontend for the HTML editor that is part of SeaMonkey.
[編集] embedding
XXX this needs a description. See Embedding.
[編集] extensions
Contains several extensions to mozilla, which can be enabled at compile-time using the --enable-extensions configure argument.
Note that some of these are now built specially and not using the --enable-extensions option. For example, disabling xmlextras is done using --disable-xmlextras.
[編集] extensions/access-builtin
XXX document me
[編集] extensions/auth
Implementation of the negotiate auth method for HTTP and other protocols. Has code for SSPI, GSSAPI, etc. See Integrated Authentication.
[編集] extensions/cck
The Client Customization Kit, Firefox version. This is actually a rewrite of Netscape's CCK which shares little more than the name and purpose with the code in cck/. See Firefox 1.5 CCK.
[編集] extensions/content-packs
Content- and locale-pack switching user interface.
[編集] extensions/cookie
Permissions backend for cookies, images etc, as well as the user interface to these permissions and other cookie features.
[編集] extensions/cview
Component viewer, which allows to view the currently registered components and interfaces.
[編集] extensions/datetime
Support for the datetime protocol.
[編集] extensions/editor
XXX csseditor support (?)
[編集] extensions/finger
Support for the finger protocol.
[編集] extensions/gnomevfs
Interface to gnome-vfs to allow using all protocols supported by gnome-vfs inside of mozilla.
[編集] extensions/help
Help viewer and help content. See Mozilla Help Viewer Project.
[編集] extensions/inspector
DOM Inspector is a tool that can be used to inspect and edit the live DOM of any web document or XUL file. See DOM Inspector.
[編集] extensions/irc
This is ChatZilla, the IRC (Internet Relay Chat) component. See ChatZilla.
[編集] extensions/java
XPCOM<->Java bridge ("JavaXPCOM", formerly known as Javaconnect). Unrelated to the code in java/.
[編集] extensions/layout-debug
Layout debugger. Intended as replacement for "viewer". Can be used to run layout regression tests and has support for other layout debugging features.
[編集] extensions/lightning
The Lightning project, "an extension to tightly integrate calendar functionality (scheduling, tasks, etc.) into Thunderbird." See Lightning.
[編集] extensions/manticore
C# based Gecko embedding. Also embeds Trident. Probably obsolete?
[編集] extensions/mono
A two-way bridge between the CLR/.NET/Mono/C#/etc. world and XPCOM.
[編集] extensions/p3p
Implementation of W3C's Platform for Privacy Preferences standard. See Platform for Privacy Preferences (P3P).
[編集] extensions/permissions
XXX writeme
[編集] extensions/pref
Preference-related extensions:
[編集] autoconfig
XXX what does this do? is it the lock_pref stuff? Could be downloading preferences from remote servers (like LDAP).
[編集] system-pref
Support for using OS-wide preferences in Mozilla, mainly for GConf (Gnome).
[編集] extensions/python
Support for implementing XPCOM components in python. See PyXPCOM.
[編集] extensions/reporter
An extension to report problems with web pages. Client-side part. See Mozilla Reporter.
[編集] extension/schema-validation
Allows to validate XML trees according to specified XML Schemas.
[編集] extension/spatialnavigation
Spatial navigation, navigating between links of a document according to their on-screen position. See Spatial Navigation.
[編集] extensions/spellcheck
Spellchecker for mailnews and composer.
[編集] extensions/sql
Support for accessing SQL databases from XUL applications. See SQL Support in Mozilla.
[編集] extensions/sroaming
Session roaming, i.e. support for storing a profile on a remote server.
[編集] extensions/tasks
Support for launching OS-provided tasks, like a calendar.
[編集] extensions/transformiix
XSLT support. XSL Transformations is a language used to transform XML documents into other XML documents. See XSL Transformations.
[編集] extensions/tridentprofile
Support for importing profiles from MSIE.
[編集] extensions/typeaheadfind
Find As You Type allows quick web page navigation when you type a succession of characters in the body of the displayed page. See Find As You Type.
[編集] extensions/universalchardet
Universal character set detector.
[編集] extensions/venkman
The JavaScript Debugger.
[編集] extensions/wallet
Password and Form Manager.
[編集] extensions/webdav
WebDAV code; exposes special APIs for accessing WebDAV servers. Used by the Calendar project.
[編集] extensions/webservices
Support for Webservices. See Web Services.
[編集] extensions/xforms
Code for the XForms extension. See XForms.
[編集] extensions/xmlextras
Several XML-related extensions. See XML Extras.
[編集] extensions/xml-rpc
XML Remote Procedure Calls. Unowned these days. See XML-RPC in Mozilla.
[編集] extensions/xmlterm
XMLTerm, a terminal implemented using mozilla technology. Only available on GTK builds.
[編集] gc
Container for garbage collection libraries, currently only boehm GC.
[編集] gc/boehm
Source code of boehm gc, not compiled by default. Used to be used for leak detection.
[編集] gfx
Contains interfaces that abstract the capabilities of platform specific graphics toolkits, along with implementations on various platforms. These interfaces provide methods for things like drawing images, text, and basic shapes. It also contains basic data structures such as points and rectangles used here and in other parts of Mozilla.
It is also the home of the new graphics architecture based on cairo (via a C++ wrapper called thebes). See NewGFXAPIs and GFXEvolution.
[編集] intl
Internationalization and localization support. See Internationalisation Projects.
- bidi
- Obsolete.
- chardet
- Code for "sniffing" the character encoding of Web pages.
- ctl
- Code for dealing with Complex Text Layout, related to shaping of south Asian languages (not built by default, needs
--enable-ctl). - locale
- Code related to determination of locale information from the operating environment.
- lwbrk
- Code related to line breaking and word breaking.
- strres
- Code related to string resources used for localization.
- uconv
- Code that converts (both ways: encoders and decoders) between UTF-16 and many other character encodings.
- unicharutil
- Code related to implementation of various algorithms for Unicode text, such as case conversion.
[編集] ipc
Container for implementations of IPC (Inter-Process Communication) mechanisms.
[編集] ipc/ipcd
The IPC daemon that is used for communication between several mozilla processes to support profile sharing. (Note that at the time of this writing (Dec 2005), profile sharing is not supported by mozilla).
[編集] jpeg
Source code of libjpeg, used by the mozilla image library.
[編集] js/src
The JavaScript engine, also known as SpiderMonkey. See also JavaScript.
[編集] js/jsd
JavaScript debugging library. See JavaScript Debugging.
[編集] js/src/xpconnect
Support code for calling JavaScript code from C++ code and C++ code from JavaScript code, using XPCOM interfaces. See XPConnect].
[編集] js/src/liveconnect
Liveconnect, the bridge between JavaScript and Java. See LiveConnect Overview.
[編集] l10n
Basically empty and not used by the mozilla build.
[編集] layout
Code that implements a tree of rendering objects that describe the types and locations of the objects that are displayed on the screen (such as CSS boxes, tables, form controls, XUL boxes, etc.), and code that manages operations over that rendering tree (such as creating and destroying it, doing layout, painting, and event handling). See documentation and other information.
- base
- Code that deals with the rendering tree.
- generic
- The basic rendering object interface and the rendering tree objects for basic CSS boxes.
- forms
- Rendering tree objects for HTML form controls.
- tables
- Rendering tree objects for CSS/HTML tables
- mathml
- Rendering tree objects for MathML.
- svg
- Rendering tree objects for SVG.
- xul
- Additional rendering object interfaces for XUL and the rendering tree objects for XUL boxes.
[編集] lib
Mostly unused; might be used on mac?
[編集] mail
Thunderbird frontend files. Note that many thunderbird files are shared with Mozilla Mailnews and can be found under mailnews/.
[編集] mailnews
The mail and news backend code (e.g. code that manages folders, manages databases, or interacts with mail servers) and the frontend code for the SeaMonkey mail client, some of which is shared by Thunderbird.
[編集] modules/libimg
Contains libpng, used by the image library for PNG Image decoding.
[編集] modules/libjar
Code to read zip files, used for reading the .jar files that contain the files for the mozilla frontend.
[編集] modules/libpr0n
Image rendering library. Contains decoders for the image formats mozilla supports.
[編集] modules/libpref
Library for reading and writing preferences.
[編集] modules/libreg
Library for reading the netscape binary registry files, used for the ~/.mozilla/appreg file (registry.dat on windows).
[編集] modules/libutil
XXX what's this??
[編集] modules/oji
Support for the Java plugin (a bridge for plugging-in generic Java VMs). See Open JVM Integration (OJI).
[編集] modules/plugin
Plugin support. Implements the Netscape Plugin-API NPAPI. See Plugins.
[編集] modules/staticmod
Helper files for static mozilla builds.
[編集] modules/zlib
Source code of zlib, used at least in the networking library for compressed transfers.
[編集] netwerk
Networking library, also known as Necko. Responsible for doing actual transfers from and to servers, as well as for URI handling and related stuff. See also Network library documentation.
[編集] nsprpub
Netscape Portable Runtime. Used as an abstraction layer to things like threads, file I/O and socket I/O. See Netscape Portable Runtime.
[編集] other-licenses
Contains libraries that are not covered by the MPL but used in some mozilla code.
[編集] parser/expat
Copy of the expat source code, which is the XML parser used by mozilla.
[編集] parser/htmlparser
Contains the html parser used by Mozilla, which parses HTML source code and calls the appropriate methods on a content sink.
[編集] plugin
Mostly obsolete. All that's left in this directory is code related to Java plugins on the Mac.
[編集] profile
Code for profile handling, the profile manager backend and frontend.
[編集] rdf
RDF handling APIs. See RDF and RDF.
Also contains the chrome registry code used by SeaMonkey, although toolkit apps (such as Firefox and Thunderbird) use the copy forked into chrome.
[編集] security
Contains NSS and PSM, to support cryptographic functions in mozilla (like S/MIME, SSL, etc). See Network Security Services (NSS) and Personal Security Manager (PSM).
[編集] storage
Storage: XPCOM wrapper for sqlite. Wants to unify storage of all profile-related data. Supersedes mork. See also Unified Storage.
[編集] suite
Newer parts of SeaMonkey-specific code. Older parts live in xpfe/.
[編集] sun-java
XXX another java directory?
[編集] themes
Contains the themes shipped with SeaMonkey. Classic and Modern at the time of this writing.
[編集] toolkit
The "new toolkit" used by Thunderbird, Firefox, etc. This contains numerous front-end components shared between applications as well as most of the XBL-implemented parts of the XUL language (most of which was originally forked from versions in xpfe/).
[編集] tools
Some tools which are optionally built during the mozilla build process, mostly used for debugging.
[編集] uriloader/base
Content dispatch in Mozilla. Used to load uris and find an appropriate content listener for the data. Also manages web progress notifications. See Document Loading: From Load Start to Finding a Handler and The Life Of An HTML HTTP Request.
[編集] uriloader/exthandler
Used to handle content that Mozilla can't handle itself. Responsible for showing the helper app dialog, and generally for finding information about helper applications.
[編集] uriloader/prefetch
Service to prefetch documents in order to have them cached for faster loading.
[編集] view
View manager. Contains cross-platform code used for painting, scrolling, event handling, z-ordering, and opacity. Soon to become obsolete, gradually.
[編集] webshell
Mostly obsolete, and being merged into docshell/.
[編集] widget
A cross-platform API, with implementations on each platform, for dealing with operating system/environment widgets, i.e., code related to creation and handling of windows, popups, and other native widgets and to converting the system's messages related to painting and events into the messages used by other parts of Mozilla (e.g. view/ and content/, the latter of which converts many of the messages to yet another API, the DOM event API).
[編集] xpcom
Cross-Platform Component Object Model. Also contains data structures used by the rest of the mozilla code. See also XPCOM Project.
[編集] xpfe
XPFE is the SeaMonkey frontend. It contains the XUL files for the browser interface, common files used by the other parts of the mozilla suite, and the XBL files for the parts of the XUL language that are implemented in XBL. Much of this code has been copied to browser/ and toolkit/ for use in Firefox, Thunderbird, etc.
[編集] xpfe/components
Components used by the Mozilla frontend, as well as implementations of interfaces that other parts of mozilla expect.
[編集] xpfe/bootstrap
Startup code for Mozilla. This contains the main/WinMain function. (Not used by "new toolkit" apps; for those, see toolkit/xre and the "app" directory for each specific app).
[編集] xpinstall
The installer, which contains code for installing Mozilla and for installing XPIs/extensions. This directory also contains code needed to build installer packages. See XPInstall and the XPInstall project page.