Graphics Reference
In-Depth Information
to buttons (the quit button). On the one hand, we understand that mouse clicks
over “on-screen slider bar area” or “on-screen button area” would result in “slider
Event. Event is a highly over-
loaded term in our discipline.
In this chapter, we use event to
mean GUI system events: an
asynchronous notification that
something
bar” and “button pressed” events being triggered. On the other hand, we also
understand that clicking on a mouse and pressing a button are two distinct events.
This section briefly discusses the propagation and translation process from the
hardware mouse clicks to the slider bar knob position events or button click events
that our application receives.
interesting
in
the
GUI system has happened.
1.3.1
The Operating System and Window Manager
On a typical computer system, the operating system (OS) is responsible for mon-
itoring the physical states of input devices (e.g., keyboard or mouse). When in-
teresting state changes occur on these devices (e.g., key presses or mouse move-
ments), the OS packages and sends this information to the window manager. The
window manager is the system application that is in charge of the entire com-
puter display screen. Just as the OS keeps track of all the processes running on a
machine, the window manager keeps track of all the application windows on the
computer display screen.
The window manger is responsible for forwarding rel-
In focus. Because all user-
triggered hardware state
changes are directed toward
the currently active window,
an active window is often
referred to as being in focus .
evant information from the OS to the currently active application. The GUI API
that our application is built upon is responsible for receiving information from
the window manager and translating and repackaging any hardware state change
information (e.g., mouse click or key press) into semantically meaningful events
(e.g., button click) for our application.
In the Linux OS X Window environment, a user has the option of working
with different window manager programs (e.g., twm, mwm). This is in contrast
with the Microsoft Windows environment, where the OS is tightly coupled with
a single window manager program. However, in both cases the window manager
keeps track of all application windows on the display screen and forwards all
relevant hardware input device state change information to the currently active
window/application.
1.3.2
The GUI API
In-focus GUI element. The
in-focus terminology also ap-
plies to individual GUI ele-
ments. For example, one can
refer to an active slider bar
as being the in-focus GUI el-
ement.
The GUI API defines icons or graphical objects to represent virtual input and
output devices. For example, a GUI API may define a 3D-looking rectangle to
represent a “button,” or a horizontal line to represent the “range” with a small 3D-
looking rectangle on top of the line to represent the “slider knob.” These virtual
devices are examples of GUI elements. Notice that the application's main window
Search WWH ::




Custom Search