GEOS SDK TechDocs
|
|
5 The GEOS User Interface
|
5.2 The Scalable User Interface
A User Interface (UI) specification is, essentially, a set of rules and conventions used to determine the interaction between a user and an application. Over the years, UI specifications have evolved from basic command-line shells to the standard graphical and pen-based systems in use today. No doubt you have come across several graphical UI specifications currently in use--Macintosh, Open Look, Presentation Manager, and OSF/Motif are a few examples.
Each of these specifications represents a particular implementation of the basic functionality required for application-user interaction. The basic functions are similar; only the implementation is different. Therefore, each of these specifications is referred to as a Specific UI .
GEOS employs a Generic UI --an implementation-independent way of defining an application's user interface. To the user, this means a single application executable can be used in any of several specific UI implementations. To the developer, this means relief from many of the UI definition tasks normally associated with graphical user interfaces.
The Generic UI can be thought of as a UI driver--a layer of abstraction between the application and the UI implementation. The programmer defines his needs in terms of basic functionality and user involvement, leaving the actual implementation (decisions about color, shape, menu structure, etc.) up to the system at run-time.
The application defines its UI by selecting certain objects from the Generic UI Library. Each of these objects has certain
attributes
that determine its specific implementation. In addition, each generic object may be assigned
hints
. Hints help the Specific UI Library determine the proper context and subjective information required to fully flesh out the proper manifestation of each generic object (for example, a GenPrimary window object can have special sizing restrictions suggested with various hints such as
HINT_FIXED_SIZE
and
HINT_INITIAL_SIZE
).
Attributes represent objective information which does not change with the specific UI in use. In general, attributes determine the basic functionality of the object regardless of its manifestation on the screen. For example, a GenView may have its scrollable attribute set; this means that in all Specific UIs, the View will have some sort of scrollers. However, one Specific UI might implement the scrollers as bars and another might implement them as dials or cranks.
Attributes are always allocated space in an object's instance data regardless of whether the attribute it set. For example, all GenView objects have a bit specifying whether it is scrollable or not. Attributes are used, therefore, primarily for determining the object's functionality rather than its appearance.
Hints represent subjective or contextual information about objects. Hints are different from attributes in two main aspects: First, hints may be ignored by certain Specific UIs. Suppose, for example, that a given Specific UI only allowed horizontal ordering of components within dialog boxes. This specific UI would ignore the hint
HINT_ORIENT_CHILDREN_VERTICALLY
applied to any GenInteraction object implemented as a dialog box.
Second, hints are dynamically added to each object's instance data in a special format known as variable data . Variable data fields are not allocated within the object's instance data unless they are used. Thus, objects with fewer hints use less memory. Attributes, on the other hand, must exist in the object's instance data whether they are used or not, and they therefore require a given amount of memory.
The Generic UI Library contains a number of object classes that implement nearly all the UI functions an application will ever need. For a full description of the API of each of these classes, see the Objects Book. Some of the more common implementations (e.g. menus, dialog boxes, and scrolling views) of these objects are outlined in the sections below.
GEOS SDK TechDocs
|
|
5 The GEOS User Interface
|
5.2 The Scalable User Interface