EZ
Up Prev Next Contents


7.1 How Drag and Drop Works

Each EZwgl application has an internal window (unmapped) for communication. Drag and Drop transactions are carried out by changing the window properties of these communication windows.

For each type of information an application transfers, there is an unique internal identifier (an Atom) that specifies the information type. This identifier is called a conversion target. It is the responsibility of an application to register the conversion targets before using them. Convertion targets are created by XInternAtom or EZ_GetAtom. These routines register a name to the X server. Once created, an atom remains unique till server shutdown.

The right mouse button (Button3) is the drag and drop button for EZwgl. When a user press-and-drag Button3 over a drag source, EZwgl initiates a new DnD transaction, executes the initialization encoder (registered to the special target EZ_DND_DRAG_INIT_ATOM), build a list of conversion targets the drag source converts, and broadcast to all EZwgl applications this list of targets. It then replace the default cursor by the drag cursor if the drag source has one, or a snapshot of the drag source will be made to follow the pointer, or if a drag icon is supplied, it pops out the drag icon. Whenever the pointer moves, the drag source broadcast its position to all EZwgl applications. If the drag is over a potential drop target, the border of the potential target lights up. When the drag is released over a drop target, the following sequence of actions will be initiated.


Up Prev Next Contents

HTML Documentation Maintainance:Arturo Espinosa <arturo@nuclecu.unam.mx>