Copyright (c) Hyperion Entertainment and contributors.
BOOPSI Class Offset Base Registry
Rationale
This document is a reference for programmers who develop BOOPSI classes for Intuition, whether they are official system components or third-party classes distributed for public use.
Each BOOPSI class uses a range of tag values to identify its attributes and methods. The “master” offset assigned to a class – hereafter called its offset base – determines where that range begins.
In the past, offset bases were assigned rather arbitrarily, without official guidelines. As a result, several gadgets share the same base, so their tag values can overlap. This is unlikely to cause problems in normal use, since applications rarely provide a class with tags intended for another class. However, such collisions are best avoided. Consistent offset assignment helps prevent them and makes new assignments easier to review and maintain.
This document lists the existing offset bases, and sets out guidelines for choosing bases for new classes.
Background
BOOPSI attributes are passed in tag lists, and are therefore subject to AmigaOS’s tag conventions. The tag values TAG_DONE, TAG_IGNORE, TAG_MORE and TAG_SKIP are reserved for controlling tag-list processing. Tags specific to a subsystem, such as Intuition, are distinguished from these global control tags by having the TAG_USER bit set. Because BOOPSI is part of Intuition, class attribute tags must also have the TAG_USER bit set.
The offset base:
- establishes the starting point for a class’s attribute tag values;
- provides a non-zero offset from TAG_USER for the first attribute tag, as required by the tag conventions;
- allows class tag values to retain the TAG_USER bit, provided their offsets stay within the user-tag range;
- helps prevent tag values from overlapping or duplicating those of other classes when bases are assigned to non-overlapping ranges.