[previous] [up] [next]     [contents] [index]
Next: Styles Up: Basic Organization Previous: Basic Organization

Administrators

Two extra layers of administration have been added to manage the display-buffer and buffer-snip connections. A buffer never communicates directly with a display; instead, it always communicates with a buffer administrator, an instance of the wx:media-admin% class, which relays information to the display. Similarly, a snip communicates with a snip administrator, an instance of the wx:snip-admin% class.

The administrative layers make the editor hierarchy flexible without adding redundant complexity. For example, a buffer can be a single item within another buffer. Without administrators, the basic buffer class would also have to contain all the functionality of a display (for the containing buffer) and a snip (for the embedded buffer). Using administrators, the same buffer class can serve as both the containing and embedded buffer and provide special administrators for the embedded buffer.

A snip belong to at most one buffer via a single administrator. A buffer can only have one administrator as well. However, the administrator that connects the a buffer to the standard view can work with other such administrators. In particular, the administrator of a wx:media-canvas% (each one has its own administrator) can work with other wx:media-canvas% administrators, so a buffer can be displayed in multiple wx:media-canvas% views at the same time.

When a buffer is displayed by multiple canvases, one of the canvases' administrators is used as the buffer's primary administrator. To handle user and update events for other canvases, the buffer's administrator is temporarily changed and then restored through the buffer's set-admin method. The return value of the buffer's get-admin method thus depends on the context of the call.



PLT