README for the DD++ library =========================== By: Harry Danilevsky and Andrew Renalds Description ----------- The DD++ library is a C++ wrapper for the Motif 1.2 drag and drop preregister protocol. Its unique design not only provides a simple interface to drag and drop but also allows the movement of objects through the X server. This is done by seperating the widget associated with the drag/drop site from the data that gets manipulated. The data type class, called Draggable, provides an interface to the data conversion and data transfer functions in the form of memory stream based persistence. A programmer must derive a class from this base class and override the saveOn(), restoreFrom(), and atomName() functions. Several examples are provided (DraggableString, DraggableInt, and DraggableDouble) in the include directory. Frequently used data types can be included in the DD++ library. To create a drag site with all the default Motif properties, a programmer simply needs to instantiate the DragSite class with the widget which will be the drag site. A data type can then be assigned to the drag site via the objectToDrag() method. An example of a class derived from DragSite, called SpecificDragSite, is also provided in the include directory. This class provides additional visual functionality such as drag-over and drag-under effects. Since a drop site can accept more than one data type, a programmer must first instantiate a DropTargetList class for a drop site. For each data type a drop site will accept, a class must be derived from the DropTarget class overriding the receive() method. This method is called when a successful drop occurs for a particular data type. An object of each class derived from DropTarget is then added to the drop targets list of valid data types via the append() method. In the same way, a data type may be removed from this list via the remove() method. A more detailed description of this library can be found in issue 11 of The X Resource journal. Future Direction ---------------- Future efforts will focus on using XDR so that complete machine independence can be achieved. Any other suggestions will be gladly considered. Compilation ----------- To compile libDD++.a and test examples: - Look into makefile and modify (if necessary ) environment variables according to your directory structure. - Type 'make'. This will build lib/libDD++.a and 3 example programs in test subdirectory. - Type 'make install'. libDD++.a will be installed in LIBINSTALLDIR and the DD++ include directory will be created in INCINSTALLDIR. This package is known to compile with: 1. GNU's g++ version 2.4.1 under SunOS 4.1.3, Motif 1.2.1 2. Lucid's lcc version 3.2 under SunOS 4.1.3, Motif 1.2.1 If you compile and run it on other platforms, please let us know. Harry Danilevsky hdanilev@fnbc.com Andrew Renalds renalds@fnbc.com