/* $TOG: README /main/5 1997/03/05 11:45:52 dbl $ */
$ Motif
$
$ Copyright (c) 1987-2012, The Open Group. All rights reserved.
$
$ These libraries and programs are free software; you can
$ redistribute them and/or modify them under the terms of the GNU
$ Lesser General Public License as published by the Free Software
$ Foundation; either version 2.1 of the License, or (at your option)
$ any later version.
$
$ These libraries and programs are distributed in the hope that
$ they will be useful, but WITHOUT ANY WARRANTY; without even the
$ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
$ PURPOSE. See the GNU Lesser General Public License for more
$ details.
$
$ You should have received a copy of the GNU Lesser General Public
$ License along with these librararies and programs; if not, write
$ to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
$ Floor, Boston, MA 02110-1301 USA
%
%HISTORY

The airport program demonstrates the use of Motif Drag and Drop in both
dynamic and pre-register mode.

The demo illustrates drag and drop thru a plane/airport metaphor.
Each client represents an airport with planes at the gates.
The demo is only interesting if you run TWO clients. Flying
only makes sense from a departure airport to a destination airport.

The client displays in the center part of the main window a drawing
area with the airport track and a few planes.  Every airport has a
traffic controller that monitors outgoing planes and incoming planes.

On the left side of the main window, you can see the detailed status
of the latest outgoing flight.

On the right side of the main window, you can see the detailed status
of an incoming flight.

At the bottom of the main window is a message area displaying 
status of the flights.

On the Departure Side:
----------------------

The user can pick a plane from a gate and drag it.
At this moment the airport announces in the message area the
flight number and the departure gate number, with a message

	Flight %d leaving from gate %d

When dragging the plane icon (the plane flies) the out going airport
displays some state and produces a sound effect on every mouse motion.

When the plane is over the root window, it says: Over Ocean
When the plane is over a top level window, it says: Over Land
When the plane is over another airport, its says: Radar Echo

If a drop occurs outside of an airport, the flight is simply
returned to its departure gate, with message

	Flight %d has returned.

If a drop occurs on airport,
	the out going airport announces first: Landing.

Then it waits for the destination to request data.
When the drop is finished (successfully) a message is displayed

	Passengers from flight %d have landed safe

If the drop fails,

	an unfortunate plane crash message is shown.


On the Arrival Side:
-------------------

The traffic is initially: No Traffic

When a plane is approaching the airport, the status is: Radar Echo.
At this point, on every mouse movement the airport tracks are 
highlighted, providing a blinking feedback to the pilot.

If a drop occurs, the state is set to: Landing.

The airport then finds an available gate to taxi the plane
and obtains information from the source (starts data transfer)

The data transfered is actually the flight number.

If the drop is successful (the flight number is received from the source)
a message is displayed:

	Flight %d arrived at gate %d


Differences between PreRegister and Dynamic protocol
----------------------------------------------------

In PreRegister mode, since the destination is unaware of the
incoming flights

	1) the Traffic Control always shows: No Traffic
	2) the tracks do not blink on incoming flights.

The resources are
-----------------

Airport.trackMargin: 20 a margin inside DrawingArea
Airport.trackBackground: track background
Airport.trackForeground: track foreground
Airport.spotBackground: plane icon background color at gate
Airport.spotForeground: plane icon foreground color at gate
Airport.dragUnderBackground: track background color
Airport.dragUnderForeground: track foreground color
Airport.flyingBackground: plane icon background color when flying
Airport.noneForeground: plane color when flying over ocean or land
Airport.validForeground: plane color when over an airport
Airport.invalidForeground: plane color when over a non-airport site
Airport.bellDuration: 100
Airport.bellPercent: 100


Code Organization:
-----------------


File main.c creates the widgets and does the drawing.
File dragsource.c contains all callbacks related to the source
	drag over feedback and drag start
File dropsite.c contains all callbacks related to destination
	drag under feedback and drop site.

BUGS:
----

	Requesting Help in planes is known to be unsecure :-)
