[previous] [up] [next]     [contents] [index]
Next: Administrators Up: Media Toolbox Previous: Media Toolbox

Basic Organization

An editor or pasteboard is divided into three functional parts:

These three parts are illustrated by a simple text editor. The buffer in the editor corresponds to the text document itself. The buffer receives keyboard and mouse commands for editing the text, and manages the view of the text. The text itself is distributed among snips. Each character could be a separate snip, or multiple characters on a single line could be grouped together into a snip. The view roughly corresponds to the frame in which the text is displayed. While the buffer manages the arrangement of the text as it is displayed into a window, the view determines which window to draw into and which part of the buffer to display.

Each selectable thing in a buffer is an item. In a pasteboard, all selection and movements work on snips, so there is a one-to-one correspondence between snips and items. In an editor, one snip may own one or more consecutive items, and every item belongs to some snip. For example, in a simple text editor, each character is an item, although multiple characters may be grouped into a single snip.

The places where the insertion point can appear in an editor are the positions. If there are n items in a buffer, then there will be n + 1 positions in the buffer: one position before each item, and one position after the last item.

When a buffer is drawn into a view, then there are graphic locations associated with snips and positions. The location of a position or snip is specified in coordinates relative to the top-left corner of the buffer. Locations in an editor buffer are only meaningful if the buffer is being viewed.




[previous] [up] [next]     [contents] [index]
Next: Administrators Up: Media Toolbox Previous: Media Toolbox

PLT