System Application Manager (SAM)
As illustrated in the diagram below, SAM is a software layer that
sits on top of a number of real-time operating systems as well as
the Microsoft Windows operating system. SAM is a very compact OS
extender. In a typical system, the entire SAM software layer is
less than 25K of code.
SAM is implemented on top of Windows to make it easy to simulate
devices on a PC. This allows the Microsoft Visual Software Development
tools to be used to create applications for systems using the SAM
RTOS extender. The development library for SAM includes utilities
to convert any Windows font into a font that can be used with a
SAM enabled system as well as a utility to convert Windows bitmap
files (*.bmp) into bitmaps that can be compiled into SAM applications.
SAM's main function is to extend the RTOS API's with a simple screen
management library that includes 2D graphics and proportional font
drawing. Perhaps more importantly, SAM provides screen and input
control arbitration between applications. To keep the programming
model and user interface requirement straightforward, SAM implements
the simple windowing system illustrated in the diagram below.
NOTE: The Video layer is only appropriate on televisions and is
not directly managed by SAM.
SAM supports two classes of application: standard and system. One
standard application is onscreen at a time. An example of a standard
application might be a web browser, address book, or onscreen program
guide. The system application class is intended for small applications
that control system functions and should always be available to
the user. A good example of a system application is the menu or
navigation application that allows the user to select between standard
applications. Another example might be volume control.
Under normal operation, a standard application is onscreen and
is the only application receiving input or drawing to the screen.
A background application (i.e. another standard application that
does not currently have control of the screen) can notify the user
that something interesting has happened using a notification window.
For example, while the user is browsing the web, an e-mail application
might pop-up a scrolling marquee saying "You have new mail".
SAM's graphics and clipping libraries allow applications to create
arbitrarily shaped notification windows. When the current onscreen
standard application draws to the screen, it is automatically prevented
from drawing over the notification window.
When the user brings up a system application over a standard application,
the same clipping system prevents the standard application from
drawing to the screen where the system application appears. System
applications also have the ability to intercept some or all of the
input. For example, the menu application might take over all input,
while volume control might only intercept the volume control keys.
Finally, either the current onscreen standard application or a
background standard application can ask the system to put up a dialog
box. A dialog box appears over all other applications and receives
input. For example, in a television system, the user might order
a pay-per-view movie that starts in 15 minutes. To kill time, the
user might switch over to a shopping virtual channel or web browser.
When the movie is about to start, the guide application is no longer
onscreen. However, it can put up a dialog that will appear over
the web browser letting the user know the movie is about to start.
A similar example in a cellphone application might have the user
checking a calendar built into the phone when a short message arrives.
The short message application could put a dialog or notification
onscreen. The advantage to the dialog is that it provides the user
with an immediate call to action.
Architecture
The red areas in the diagram below indicate the components that
make up SAM.
Portability and Kernel Layer
The Thread, Timer, Memory, and Messages blocks are simply wrappers
to the equivalent underlying functionality in the RTOS or Windows.
This allows applications to be ported easily from one RTOS to another
and for applications to be prototyped on the PC simulator.
SAM also supports flexible localization and DBCS (via Unicode)
through compile-time constants.
Graphics & Clipping
The SAM graphics library supports 2D drawing primatives including
support for proportional fonts and Windows bitmap files (*.bmp).
A development utility allows any Windows font to be converted for
use in a SAM application. SAM also supports arbitrarily shaped clipping
windows. The clipping support allows notifications, dialogs, and
system applications to appear on top of the foreground application
without having to worry about each application overwritting the
others' screen area.
Application List Management
In systems with multiple applications, it is necessary to have
some mechanism for the user to choose which application to use.
SAM does not attempt to establish a specific navigation metaphor,
but rather supports an application registry so that system developers
can easily create whatever user interface is desired. When using
SAM, all applications register with the list manager. The system
designer creates a menu or application navigation application that
uses the App List Manager to find out about other applications in
the system. For example, in the TV SAM simulator that can be downloaded
from the Demo page, the menu button on the remote control pops up
a list of applications. To change to another application, the user
simply selects an application from the list.
Notifications & Dialogs
The Notifications and Dialog module provides a mechanism for applications
to alert the user to important information when another application
has control of the system
Input Routing
SAM automatically routes keyboard, touch screen, or other forms
of input to the appropriate application. For example, in a TV system,
several applications may want to use the same keys for navigation
and input. Whichever application is onscreen will receive the input.
If a background application requires immediate user feedback it
can put up a dialog box over the current onscreen application. While
the dialog box is on screen, user input is temporarily redirected
to the dialog.
|