This document was last modified March 30, 11:45am.

Composer Module Summary

Background
Architecture
    Cross platform
    XP Notes and Warnings
    Windows Front End
    Mac Front End
    UNIX Front End
Future Plans

Background

The first Netscape HTML editor was first introduced in "Navigator Gold 2.0" in 1996, where the "Gold" aspect was essentially the Editor. With version 3.0, Mac and UNIX versions were available. With Communicator 4.0, the editor was renamed "Composer" and was used to write mail messages as well (the "Message Composer").
Composer was designed to be: Composer was not designed to be:

Architecture

Most generally, there are two layers to the implementation: the Cross Platform ("Backend" or "XP" ) system and the Front End ("FE") code specific to each platform.  We will use the term "Editor" to refer to the components common to the Page Composer module and Mail Message Composer modules -- the XP Editor core and the View class shared by the Page and Message components.  The Editor XP system consists entirely of C++ objects internally, but the interface to each front end is through the global "EDT_" C functions. Likewise, callbacks to each Front End are global "FE_" functions, even though the Front Ends are written mostly in C++.

Cross platform ("Backend" or "XP" code)

The Editor API (as well as shared string definitions) header files are in include:
 
edt.h  Main API declarations - all global functions begin with "EDT_"
edttypes.h Structures, data types, global defines. Structure names begin with "EDT_". Defines and data types begin with "ED_"
fe_proto.h Function declarations common to each platform's front end. All begin with "FE_"
allxpstr.h Message strings shared by all platforms. [In Windows: After adding or changing strings, copy this file to "allxpstr.rc" for use by the resource compiler.]
  The cross platform code is mostly contained in these files in lib/layout:
editor.h 
fsfile.h  The "Tape File System" used for file IO
streams.h  File and memory data streams
edttypep.h  Defines for data types to editor classes
 
 Implementation files used exclusively by Composer:
editor.cpp  Implementation that maps global EDT_ functions to CEditBuffer methods and other editor objects.
edtbuf.cpp  Edit buffer - contains and manages the HTML data object tree
edtele.cpp  HTML data objects
edtcmd.cpp  Interface for "commands" that can be undone (from an early attempt at multiple-level undo system - this layer should be eliminated if we stick with single-level undo!)
edtjava.cpp  Java-related code for Editor Plugins
edtsave.cpp  File and image loading, saving, and publishing
edtutil.cpp  Misc. helpers and classes used by selection, object sizing, autosave timer, etc.
fsfile.cpp  Tape file system implementation
streams.cpp  File and memory streams implementation
 

Other files in lib/layout include Composer-specific code dealing with layout in a Composer view window. One way to find most of the Composer-specific areas is to search for "#ifdef EDITOR" in the source files.

XP Notes and Warnings

Windows Front End

The Windows Front End is an MFC-based architecture mostly adhering to the Document/Frame/View model, except that CDocument is not as important as it normally is in MFC programs. The CFrame- derived classes contain the User Interface elements such as toolbars, status line, and menus (the "chrome") -- here is the class hierarchy:
CFrameWnd -> CNSGenFrame -> CGenericFrame -> CMainFrame -> CEditFrame
The Browser window is a CMainFrame object. Likewise, there is a hierarchy of View classes:
CView -> CGenericView -> CNetscapeView -> CNetscapeEditView
Most of the Windows messages are routed to the CNetscapEditView.

Winfe Notes and Warnings

Mac Front End

The Macintosh Front End is mostly written in C++ based on PowerPlant classes.  The main editor functionality can be found in CEditView.cp (based on class CHTMLView) and CEditorWindow.cp (based on class CBrowserWindow).

UNIX Front End

(To be completed)

Future Plans

This is a short version of the many ideas Netscape designers and engineers have suggested, as well as input from our customers: