Download 1990 , Volume , Issue Oct-1990

Transcript
HP IVI Application Program Interface
Design
To provide the features available in HP IVI, the internal
design and implementation of the application program
interface leveraged concepts and software from graphics
packages, window technology, widgets, Xt Intrinsics, and
object-oriented design.
by Pamela W. Munsch, Warren I. Otsuka, and Gary D. Thomsen
ONE OF THE MAIN goals of the HP Interactive Vis
ual Interface (HP IVI) project was to leverage fea
tures from current user interface and software de
sign technologies and blend the best of each into the feature
set and design of the application program interface (API)
functions. In doing so, the project team investigated win
dowing, graphics, the X toolkit (Xt Intrinsics), widgets, and
object-oriented design. This article discusses the features
used from each of these technologies, and how these fea
tures are incorporated into the internal design and im
plementation of the API functions (see Fig. 1).
Windowing
To hide the complexities of the X Window System1'2
from HP IVI application developers, the API provides a
layer of simplifying software over X. The only X features
left exposed are those that we thought the application de
veloper must have access to, or that cannot be layered over.
Even with this layer of software, the user still has access
to X functions. For example, X provides an event called
ConfigureNotify that tells the application that a window has
been resized, moved, or changed in some way. The API
handles resizing the window object when this event occurs
but lets the application decide if all the objects in the win
dow should be resized to match the new window's size,
or if the objects should maintain their sizes and only the
coordinate system of the window should be adjusted. The
user still has direct access to the X functions if they are
needed.
The API also ensures that all X events (e.g., a mouse
button press and release) that occur in a window object
are sent to the application. This is done through callback
techniques based on the Xt callback mechanism. There are
also mechanisms and data structures to provide a linkage
between X event data formats and API data formats.
features as offered by Starbase.
Graphics packages provide coordinate systems that:
• Communicate with a particular device (device coordi
nates)
• Provide display resolution independence (normalized
or virtual device coordinates)
• Allow the user to work in a system that reflects their
world (world coordinates)
• Allow users to move, scale, or rotate images easily with
out recalculating the placement and size of the image
(modeling transformations).
Device coordinates (DCs) are the coordinates used to
write to a device. For the X Window System, device coor
dinates are defined in pixels.
Virtual device or normalized device coordinates (NDCs)
provide a means to gain independence from the resolution
of the display. This coordinate system maps the width and
height of a display to the coordinate range from 0.0 to 1.0.
Normalized device coordinates define a viewport. A view
port is a rectangular drawing region on the display surface.
Specifying the viewport in NDCs maintains the ratio be
tween the drawing area and the display size regardless of
the display resolution.
World coordinates provide a user-defined coordinate
system. This system allows users to create pictures using
the most appropriate coordinate system for the task. For
example, if the world coordinates represent the physical
dimensions of a factory, using the dimensions from a blue
print of the factory to create a picture is straightforward.
World coordinates define which area of the unbounded
Graphics
Most graphics packages, such as Hewlett-Packard's Starbase graphics package,3 provide coordinate systems that
allow users to write device independent graphics programs.
Since creating a user interface with the X Window System
is currently done using pixels, the API project team decided
to provide API functions that enable user-interface design
ers the same type of device independent coordinate system
User Application
API Functions
API Internal Technologies
• Graphics
• Windows
• Widgets
• Xt Intrinsics
• Object-Oriented Design
Fig. 1 . The software technologies incorporated into the inter
nal design and implementation of the HP IVI application pro
gram interface (API).
OCTOBER 1990 HEWLETT-PACKARD JOURNAL 21
© Copr. 1949-1998 Hewlett-Packard Co.