/* $TOG: README /main/5 1997/03/05 11:45:52 dbl $ */ %@OPENGROUP_COPYRIGHT@ %COPYRIGHT NOTICE %Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc. %Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group %ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for %the full copyright text. % %This software is subject to an open license. It may only be %used on, with or for operating systems which are themselves open %source systems. You must contact The Open Group for a license %allowing distribution and sublicensing of this software on, with, %or for operating systems which are not Open Source programs. % %See http://www.opengroup.org/openmotif/license for full %details of the license agreement. Any use, reproduction, or %distribution of the program constitutes recipient's acceptance of %this agreement. % %EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS %PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY %KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY %WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY %OR FITNESS FOR A PARTICULAR PURPOSE % %EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT %NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, %INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL %DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED %AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT %LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN %ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE %EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE %POSSIBILITY OF SUCH DAMAGES. % %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 :-)