WASTE features

Unicode (UTF-16) backing store
All rendering done with Core Graphics
Built-in compositing HIView wrapper
Supports all Mac OS X keyboards and input methods
Text layout based on ATSUI
Unlimited multiple undo/redo
Rich character-level formatting (font, size, text and highlight colors, bold, italic, underline, shadow, strikethrough, superscript and subscript, etc.)
Paragraph-level formatting: each paragraph can have its own alignment, margins, line spacing, first-line indent, and tabs (left, center, right, and decimal-aligned)
Built-in RTF parser/generator, including inline and out-of-line images and most Cocoa extensions
Clipboard and drag-and-drop support with seamless conversion to and from legacy scrap formats, including TEXT/styl and WASTE 2.1 proprietary types
APIs for printing and string matching
Extensible attribute architecture: clients can define any number of custom attributes, both character- and paragraph-level
Embedded object architecture
Grouping (aka protected text)
Character Palette support
Dictionary lookup support
Support for the Glyph Access Protocol
Spell checking
Accessibility/VoiceOver support
95%+ backward compatibility with WASTE 2.1

Core Architecture

WASTE 3 was engineered using modern object oriented design principles and patterns, and written in C++, making extensive use of the Standard Template Library (STL). It's based on a Model-view-controller architecture.

The model object owns the UTF-16 backing store, and keeps track of character- and paragraph-level attributes and embedded objects, but knows nothing about layout, it doesn't handle any user event, perform any drawing, nor maintain a selection range.

Layout objects are responsible for flowing a text range into a destination rectangle, measuring text, calculating line breaks, and mapping character offsets to geometric positions and back.

View objects represent areas of the screen (or other output context) where text is actually drawn and scrolled. Each view has a layout object associated with it. Views are responsible for painting the background, highlight regions, carets, and text. All drawing ultimately takes place into a Core Graphics context.

The controller is the object that holds all the pieces together. It acts as a bridge between the model and zero, one or more views. It handles user events, maintains a selection range, keeps drag and pasteboard promises, blinks the caret. It also coordinates with the text input manager and the undo manager.

The text input manager is basically a collection of a dozen different Carbon event handlers needed for Mac OS X's sophisticated text input interface. Properly handling text input in Mac OS X goes far beyond merely accepting keypresses: it involves maintaining an inline input area for input methods such as Kotoeri, accepting characters and unencoded glyphs from the Character Palette, and supporting dictionary lookup.

The undo manager keeps a history of editing actions occurring in the controller object, using a double stack of action objects. Each action object encapsulates enough information to reverse the effects of an editing step. Multiple actions can be grouped into complex sequences to be treated as a single undo step. A notification mechanism allows the client application to integrate WASTE's undo machinery with its own undo/redo stacks.