1
/* $TOG: README /main/5 1997/03/05 11:45:52 dbl $ */
4
%Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
5
%Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
6
%ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
7
%the full copyright text.
9
%This software is subject to an open license. It may only be
10
%used on, with or for operating systems which are themselves open
11
%source systems. You must contact The Open Group for a license
12
%allowing distribution and sublicensing of this software on, with,
13
%or for operating systems which are not Open Source programs.
15
%See http://www.opengroup.org/openmotif/license for full
16
%details of the license agreement. Any use, reproduction, or
17
%distribution of the program constitutes recipient's acceptance of
20
%EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
21
%PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
22
%KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
23
%WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
24
%OR FITNESS FOR A PARTICULAR PURPOSE
26
%EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
27
%NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
28
%INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
%DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
30
%AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
%LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32
%ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
33
%EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
34
%POSSIBILITY OF SUCH DAMAGES.
38
The airport program demonstrates the use of Motif Drag and Drop in both
39
dynamic and pre-register mode.
41
The demo illustrates drag and drop thru a plane/airport metaphor.
42
Each client represents an airport with planes at the gates.
43
The demo is only interesting if you run TWO clients. Flying
44
only makes sense from a departure airport to a destination airport.
46
The client displays in the center part of the main window a drawing
47
area with the airport track and a few planes. Every airport has a
48
traffic controller that monitors outgoing planes and incoming planes.
50
On the left side of the main window, you can see the detailed status
51
of the latest outgoing flight.
53
On the right side of the main window, you can see the detailed status
54
of an incoming flight.
56
At the bottom of the main window is a message area displaying
57
status of the flights.
59
On the Departure Side:
60
----------------------
62
The user can pick a plane from a gate and drag it.
63
At this moment the airport announces in the message area the
64
flight number and the departure gate number, with a message
66
Flight %d leaving from gate %d
68
When dragging the plane icon (the plane flies) the out going airport
69
displays some state and produces a sound effect on every mouse motion.
71
When the plane is over the root window, it says: Over Ocean
72
When the plane is over a top level window, it says: Over Land
73
When the plane is over another airport, its says: Radar Echo
75
If a drop occurs outside of an airport, the flight is simply
76
returned to its departure gate, with message
78
Flight %d has returned.
80
If a drop occurs on airport,
81
the out going airport announces first: Landing.
83
Then it waits for the destination to request data.
84
When the drop is finished (successfully) a message is displayed
86
Passengers from flight %d have landed safe
90
an unfortunate plane crash message is shown.
96
The traffic is initially: No Traffic
98
When a plane is approaching the airport, the status is: Radar Echo.
99
At this point, on every mouse movement the airport tracks are
100
highlighted, providing a blinking feedback to the pilot.
102
If a drop occurs, the state is set to: Landing.
104
The airport then finds an available gate to taxi the plane
105
and obtains information from the source (starts data transfer)
107
The data transfered is actually the flight number.
109
If the drop is successful (the flight number is received from the source)
110
a message is displayed:
112
Flight %d arrived at gate %d
115
Differences between PreRegister and Dynamic protocol
116
----------------------------------------------------
118
In PreRegister mode, since the destination is unaware of the
121
1) the Traffic Control always shows: No Traffic
122
2) the tracks do not blink on incoming flights.
127
Airport.trackMargin: 20 a margin inside DrawingArea
128
Airport.trackBackground: track background
129
Airport.trackForeground: track foreground
130
Airport.spotBackground: plane icon background color at gate
131
Airport.spotForeground: plane icon foreground color at gate
132
Airport.dragUnderBackground: track background color
133
Airport.dragUnderForeground: track foreground color
134
Airport.flyingBackground: plane icon background color when flying
135
Airport.noneForeground: plane color when flying over ocean or land
136
Airport.validForeground: plane color when over an airport
137
Airport.invalidForeground: plane color when over a non-airport site
138
Airport.bellDuration: 100
139
Airport.bellPercent: 100
146
File main.c creates the widgets and does the drawing.
147
File dragsource.c contains all callbacks related to the source
148
drag over feedback and drag start
149
File dropsite.c contains all callbacks related to destination
150
drag under feedback and drop site.
155
Requesting Help in planes is known to be unsecure :-)