.nr T1 0
.nr T1 0
.nr F1 0
.TH draganddrop 3w "19 July 91" "Version 3.0" "OLIT Widget Set"
.IX "utilities" "drag and drop" "" "" PAGE MAJOR
.IX "drag and drop" "" "" "" PAGE MAJOR
.SH NAMES
.nh
OlDnDAllocTransientAtom,
OlDnDBeginSelectionTransaction,
OlDnDChangeDropSitePreviewHints,
OlDnDOwnSelection,
OlDnDOwnSelectionIncremental,
OlDnDDeliverPreviewMessage,
OlDnDDeliverTriggerMessage,
OlDnDDestroyDropSite,
OlDnDDisownSelection
OlDnDDragAndDrop,
OlDnDDragNDropDone,
OlDnDEndSelectionTransaction,
OlDnDErrorDuringSelectionTransaction,
OlDnDFreeTransientAtom,
OlDnDGetCurrentSelectionsForWidget,
OlDnDGetDropSitesOfWidget,
OlDnDGetDropSitesOfWindow,
OlDnDGetWidgetOfDropSite,
OlDnDGetWindowOfDropSite,
OlDnDInitializeDragState,
OlDnDQueryDropSiteInfo,
OlDnDRegisterWidgetDropSite,
OlDnDRegisterWindowDropSite,
OlDnDUpdateDropSiteGeometry,
OlDnDWidgetConfiguredInHier \- drag and drop functions
.SH DESCRIPTION
.nh
Drag and Drop is a gesture in which the user "picks up" a representation of data or objects on the desktop, drags it across the desktop, and drops it on some other part of the desktop.  Drag and drop effectively transfers information from one part of the desktop to another part of the desktop. 
.LP
Examples of Drag and Drop operations are:
.IP \(em 1.5P
Picking up a file from a file manager and dropping it on a trash can
to delete the file.
.IP \(em 1.5P
Selecting arbitrary text in a text editor, and subsequently dragging and
dropping it on another text editor to execute a quick cut and paste.
.IP \(em 1.5P
Selecting a region in a spreadsheet application and dragging
and dropping it to a desktop publishing package to create a hot 
link in the editor to the spreadsheet data.
.HP
.SH DROP SITE MANIPULATION
.nh
A drop site is a collection of rectangles within a widget or window of an application that can receive a drop.  These rectangles are "sensitive" to drops on them.  When a user performs a drop over one of the sensitive rectangles of a drop site, the owner of the dropsite is notified that some other agent on the desktop is prepared to provide data via a selection transfer.
.LP
Drop sites can provide feedback to the user during a drop operation when the drop site is intersected during a drag operation. A mechanism exists to indicate that a drop site should be notified of an intersection with the drag gesture. See the Delivering Preview Messages section below.
.LP
The owner of a drop site, i.e the agent that registered the drop site, must maintain the geometry and global registration (interest) of the drop site in synchronisation with the geometry, map state and visibility of the widget or window associated with the drop site.
.br
.br
.LP
The current Drag and Drop API contains the following functions for
manipulation of drop sites:
.LP
.IP \(em 1.5P
register a widget based drop site  
.JL OlDnDRegisterWidgetDropSite() "" -
.IP \(em 1.5P
register a window based drop site 
.JL OlDnDRegisterWindowDropSite() "" -
.IP \(em 1.5P
update a drop site's geometry
.JL OlDnDUpdateDropSiteGeometry() "" -
.IP \(em 1.5P
update a drop site's preview hints
.JL OlDnDChangeDropSitePreviewHints() "" -
.IP \(em 1.5P
delete an existing drop site
.JL OlDnDDestroyDropSite() "" -
.IP \(em 1.5P
query a drop site's geometry
.JL OlDnDQueryDropSiteInfo() "" -
.IP \(em 1.5P
get a window associated with a drop site
.JL OlDnDGetWindowOfDropSite() "" -
.IP \(em 1.5P
get a widget associated with a drop site
.JL OlDnDGetWidgetOfDropSite() "" -
.IP \(em 1.5P
get the drop sites for a widget
.JL OlDnDGetDropSitesOfWidget() "" -
.IP \(em 1.5P
get the drop sites for a window
.Jl OlDnDGetDropSitesOfWindow() "" -
.SH "DROP SITE MANIPULATION STRUCTURES"
.IP
.IP
.SS "OlDnDDropSiteID"
.IX "OlDnDDropSiteID" "" "\fOlDnDDropSiteID\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDropSiteID" "" "\fLOlDnDDropSiteID\fP"
.IP Synopsis:
.JL
.nf
typedef struct oldnd_drop_site *OlDnDDropSiteID	
.br
.JR
.fi
.LP 
.JL OlDnDDropSiteID
is an opaque reference to a particular instance of a drop site. 
.SS OlDnDSiteRect 
.IX "OlDnDSiteRect" "" "\fOlDnDSiteRect\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDSiteRect" "" "\fLOlDnDSiteRect\fP"
.IP Synopsis:
.JL
.nf
typedef struct {
		int		  x, y;
		unsigned int	  width, height;
		} OlDnDSiteRect, *OlDnDSiteRectPtr;

.br
.JR
.fi
.LP 
The
.JL OlDnDSiteRect
structure describes the drop site rectangle. The (x, y) pair defines the origin of the drop site rectangle in the co-ordinate space of the drop site's owning widget or window. The (width, height) pair define the dimensions of this rectangle of the drop site. Drop sites can include multiple rectangles.
.SS OlDnDSitePreviewFlags
.IX "OlDnDSitePreviewFlags" "" "\fOlDnDSitePreviewFlags\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDSiteRect" "" "\fLOlDnDSitePreviewFlags\fP"
.IP Synopsis:
.JL
.nf
typedef enum {
		OlDnDSitePreviewNone,
		OlDnDSitePreviewEnterLeave,
		OlDnDSitePreviewMotion,
		OlDnDSitePreviewBoth,
		OlDnDSitePreviewDefaultSite
		OlDnDSitePreviewForwarded,
		OlDnDSitePreviewInsensitive,
		} OlDnDSitePreviewHints;
.br
.JR
.fi
.LP 
The
.JL OlDnDSitePreviewFlags
structure specifies preview characteristics.
.fi
.JR
.RS
.HP	
.I "OlDnDSitePreviewNone" 
specifies previewing.  TRUE specifies no previewing.
.HP
.I "OlDnDSitePreviewEnterLeave"
specifies whether or not to preview Enter/Leave events.
.HP
.I "OlDnDSitePreviewMotion"
specifies previewing of motion events.
.HP
.I "OlDnDSitePreviewBoth"
specifies previewing of Enter/Leave and motion events.
.HP
.I "OlDnDSitePreviewDefaultSite"
specifies that the drop site is the default site for drop site forwarding on this application shell.  Note that a default drop site is the site nominated to receive drops forwarded byt the window manager decorations or icons.
.SH DROP SITE MANIPULATION CALLBACKS
.IP
.IP
.SS OlDnDTMNotifyProc
.IX "OlDnDTMNotifyProc" "" "\fOlDnDTMNotifyProc\fP" "" PAGE MAJOR
.IX "drag and drop utilities" OlDnDTMNotifyProc" "" "\\fP" "" PAGE MAJOR
.IP Synopsis:
.JL
.nf
#include <Xol/OlDnDVCX.h>
 . . . 
typedef Boolean (*OlDnDTMNotifyProc)(
.in \n(Ji
.ds Jf OlDnDTriggerOperation
.JF Widget \fIwidget\fP,
.JF Window \fIwindow\fP,
.JF Position \fIroot_x\fP,
.JF Position \fIroot_y\fP,
.JF Atom \fIselection\fP,
.JF Time \fItime\fP,
.JF OlDnDDropSiteID \fIdropsiteid\fP,
.JF OlDnDTriggerOperation \fIoperation\fP,
.JF Boolean \fIsend_done\fP,
.JF Boolean \fIforwarded\fP,
.JF XtPointer \fIclosure\fP);
.JR
.in
.fi
.LP
.JL OlDnDTMNotifyProc
is the function prototype for the drop operation trigger message notifier. This notifier, associated with a particular drop site at registration, is invoked when a drop operation occurs on its associated drop site.
.fi
.JR
.RS
.HP
.I "widget" 
is the owning widget of the drop site
.HP
.I "window" 
is the owning window of the drop site
.HP
.I "root_x" 
is the root-relative x coordinate at which the drop occurred
.HP
.I "root_y" 
is the root-relative y coordinate at which the drop occurred
.HP
.I "selection" 
is the selection atom for the selection transfer of the drop information.
.HP
.I "time" 
is the timestamp of the trigger message
.HP
.I "dropsiteid" 
is the id of the drop site on which the drop occurred
.HP
.I "operation" 
is either OlDnDTriggerCopyOp or OlDnDTriggerMoveOp
.HP
.I "send_done" 
if TRUE the selection holder expects to be notified at the end of the selection transaction that it has been completed and that no further transactions associated with this drop will occur. This notification is achieved by calling OlDnDDragNDropDone() when the selection transaction is completed successfully.
.HP
.I "closure"
is user defined data
.SS OlDnDDragNDropDone
.IX "OlDnDDragNDropDone" "" "\fOlDnDDragNDropDone\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDragNDropDone" "drag and drop utilities" "\fLOlDnDDragNDropDone\fP" PAGE MAJOR
.IP Synopsis:
.JL
.nf
#include <Xol/OlDnDVCX.h>
 . . . 
typedef OlDnDPreviewMessageNotifyProc (*OlDnDPMNotifyProc)(
.in \n(Ji
.ds Jf OlDnDTriggerOperation
.JF Widget \fIwidget\fP,
.JF Window \fIwindow\fP,
.JF Position \fIroot_x\fP,
.JF Position \fIroot_y\fP,
.JF Atom \fIselection\fP,
.JF Time \fItime\fP,
.JF OlDnDDropSiteID \fIdropsiteid\fP,
.JF OlDnDTriggerOperation \fIoperation\fP,
.JF Boolean \fIsend_done\fP,
.JF Boolean \fIforwarded\fP,
.JF XtPointer \fIclosure\fP);
.JR
.in
.fi
.SS OlDnDPMNotifyProc
.IX "OlDnDPMNotifyProc" "" "\fOlDnDPMNotifyProc\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDPMNotifyProc" "drag and drop utilities" "\fLOlDnDPMNotifyProc\fP" PAGE MAJOR
.IP Synopsis:
.JL
.nf
#include <OlCursors.h>
 . . .
extern Pixmap OlGet75PercentGrey(
.in \n(Ji
.ds Jf Screen
.JF Screen     *\fIscreen\fP);
.in
.JR
.fi
.LP
The 
.JL OlDnDPMNotifyProc
procedure is the function prototype for the drop site preview message notifier. This notifier is associated with a particular drop site at registration.  It is invoked when a drop operation in progess either enters, leaves, or moves across the drop site.  Which of these actions invokes the notifier depends on the current value of the drop site's preview_hints.
.fi
.JR
.RS
.HP
.I "widget" 
is the owning widget of the drop site
.HP
.I "window" 
is the owning window of the drop site
.HP
.I "root_x" 
is the root-relative x coordinate of preview "event"
.HP
.I "root_y" 
root relative-y coordinate of preview "event"
.HP
.I "detail" 
is the event type, either Enter, Leave or Motion.
.HP
.I "time" 
is the time of "preview" event
.HP
.I "dropsiteid" 
is the id of the drop site on which the preview occurred
.HP
.I "closure" 
is user defined data
.SH DROP SITE MANIPULATION FUNCTIONS
.IP
.IP
.SS OlDnDRegisterWidgetDropSite
.IX "OlDnDRegisterWidgetDropSite" "" "\fOlDnDRegisterWidgetDropSite\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDRegisterWidgetDropSite" "" "\fLOlDnDRegisterWidgetDropSite\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
OlDnDDropSiteID OlDnDRegisterWidgetDropSite(
.in \n(Ji
.ds Jf OlDnDSitePreviewHints
.JF Widget    \fIwidget\fP,
.JF OlDnDSitePreviewHints  \fIpreview_hints\fP,
.JF OlDnDSiteRectPtr    \fIsites\fP,
.JF "unsigned int"     \fInum_sites\fP,
.JF OlDnDTMNotifyProc   \fItm_notify\fP,
.JF OlDnDPMNotifyProc   \fIpm_notify\fP,
.JF Boolean    \fIon_interest\fP,
.JF XtPointer    \fIclosure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDRegisterWidgetDropSite
function creates a drop site associated with a particular widget.  A widget must be realized, that is it must have an X Window associated with it, before you can create a drop site for it.  Gadgets can support drop sites and use their windowed ancestor's X Window in association with the registered drop site.  Drop sites are automatically destroyed when their owning widgets die.
.fi
.JR
.RS
.HP	
.I "widget" 
is the widget to which the drop site belongs.
.HP
.I "preview_hints" 
is an enum of type OlDnDSitePreviewHints that defines the type(s) of preview events this drop site is interested in receiving during a drag across it.
.HP
.I "sites"
is a list of
.JL OlDnDSiteRect
which defines the rectangles in the cordinate system of the widget that defines the drop site.	
.HP
.I "num_sites" 
is the number of rectangles defining the drop site.
.HP
.I "tm_notify"
is a function pointer of type OlDnDTMNotifyProc that is called when a drop occurs on this drop site
.HP
.I "pm_notify"
is a function pointer of type OlDnDPMNotifyProc.  It is invoked when a drop operation in progess either enters, leaves, or moves across the drop site.  Which action invokes the notifier depends on the current value of the drop site's preview_hints.
.HP
.I "closure"
is a user defined parameter which is passed to the tm_notify and pm_notify functions when they are called.
.#
.#
.SS OlDnDRegisterWindowDropSite
.IX "OlDnDRegisterWindowDropSite" "" "\fOlDnDRegisterWindowDropSite\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDRegisterWindowDropSite" "" "\fOlDnDRegisterWindowDropSite\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
OlDnDDropSiteID OlDnDRegisterWindowDropSite(
.in \n(Ji
.ds Jf OlDnDSitePreviewHints
.JF Display   \fIdpy\fP,
.JF Window   \fIwindow\fP,
.JF OlDnDSitePreviewHints \fIpreview_hints\fP,
.JF OlDnDSiteRectPtr  \fIsite\fP,
.JF "unsigned int"    \fInum_sites\fP,
.JF OlDnDTMNotifyProc  \fItm_notify\fP,
.JF OlDnDPMNotifyProc  \fIpm_notify\fP,
.JF Boolean   \fIon_interest\fP,
.JF XtPointer   \fIclosure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDRegisterWindowDropSite
procedure registers a window-based drop site. It creates a drop site associated with a particular X Window and is useful for toolkit applications that mix `raw' X windows with widgets. Drop sites are automatically destroyed when their owning windows die. The window must be an inferior of a widgets window.	
.fi
.JR
.RS
.HP	
.I "window"
is the window to which the drop site belongs.
.HP	
.I "preview_hints"
is an enum of type OlDnDSitePreviewHints that defines the type(s) of preview events this drop site is interested in receiving during a drag across it.	
.HP
.I "sites"
is a list of OlSiteRect which defines the rectangles in the cordinate system of the window that defines this drop site.						 .HP	
.I "num_sites"
is the number of rectangles defining this drop site.
.HP	
.I "tm_notify"
is a function pointer of type OlDnDTMNotifyProc that is called when a drop occurs on the drop site
.HP	
.I "pm_notify"
is a function pointer of type OlDnDPMNotifyProc which is called,  It is invoked when a drop operation in progess either enters, leaves, or moves across the drop site.  Which action invokes the notifier depends on the current value of the drop site's preview_hints.
.HP	
.I "closure"
is a user-defined parameter that is passed to the tm_notify and pm_notify functions when they are called.
.#
.#
.SS OlDnDUpdateDropSiteGeometry
.IX "OlDnDUpdateDropSiteGeometry" "" "\fOlDnDUpdateDropSiteGeometry\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDUpdateDropSiteGeometry" "" "\fLOlDnDUpdateDropSiteGeometry\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDUpdateDropSiteGeometry(
.in \n(Ji
.ds Jf OlDnDSiteRectPtr
.JF OlDnDDropSiteID   \fIdropsiteid\fP,
.JF OlDnDSiteRectPtr   \fIsite_rects\fP,
.JF "unsigned int"     \fInum_sites\fP);
.JR
.in
.fi
.JL
.LP
The 
.JL OlDnDUpdateDropSiteGeometry 
function alters the geometry of a drop site. Changes in the geometry of a drop site are caused by changes in the geometry of the widget or window that owns the drop site. To reduce client-server traffic, the Drag and Drop implementation does not automatically track changes in the window that owns a drop site.  The creator of a drop site is responsible for maintaining the geometry of the site to reflect any changes in the widget or window that owns the site.
.fi
.JR
.RS
.HP	
.I "dropsiteid"
is the id of the drop site to be updated
.HP	
.I "site_rects"
is the new list of site rectangles for the drop site
.HP	
.I "num_sites"
is the number of rectangles in the new rectangle list.
.#
.#
.SS OlDnDWidgetConfiguredInHier
.IX "OlDnDWidgetConfiguredInHier" "" "\fOlDnDWidgetConfiguredInHier\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDWidgetConfiguredInHier" "" "\fLOlDnDWidgetConfiguredInHier\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDWidgetConfiguredInHier(
.in \n(Ji
.ds Jf Widget
.JF Widget \fIwidget\fP);
.JR
.in
.fi
.LP
.SS OlDnDChangeDropSitePreviewHints
.IX "OlDnDChangeDropSitePreviewHints" "" "\fOlDnDChangeDropSitePreviewHints\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDChangeDropSitePreviewHints" "" "\fLOlDnDChangeDropSitePreviewHints\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDUpdateDropSiteGeometry(
.in \n(Ji
.ds Jf OlDnDSiteRectPtr
.JF OlDnDDropSiteID   \fIdropsiteid\fP,
.JF OlDnDSiteRectPtr   \fIsite_rects\fP,
.JF "unsigned int"     \fInum_sites\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDUpdateSitePreviewHints
procedure updates a drop site's preview hints.  During the lifetime of a drop site it may be necessary to alter the nature of its previewing interest.   Use
.JL OlDnDUpdateSitePreviewHints() 
to overwrite the existing preview hints for a drop site and update the drop site interest list appropriately.
.fi
.JR
.RS
.HP	
.I "dropsiteid"
is the id of the drop site
.HP	
.I "hints"
is the new preview flag settings for this site

.HP	
.#
.SS OlDnDDestroyDropSite
.IX "OlDnDDestroyDropSite" "" "\fOlDnDDestroyDropSite\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDRegisterWidgetDropSite" "" "\fOlDnDDestroyDropSite\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDDestroyDropSite(
.in \n(Ji
.ds Jf OlDnDDropSiteID
.JF OlDnDDropSiteID   \f2dropsiteid\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDDestroyDropSite
explictly destroys a drop site. Note that when a drop site's widget or window is destroyed, all drop sites associated with that widget or window are automatically destroyed.
.fi
.JR
.RS
.HP	
.I "dropsiteid"	
is the id of the drop site
.#
.#
.SS OlDnDQueryDropSiteInfo
.IX "OlDnDQueryDropSiteInfo" "" "\fOlDnDQueryDropSiteInfo\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDQueryDropSiteInfo" "" "\fLOlDnDRegisterWidgetDropSite\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDQueryDropSiteInfo(
.in \n(Ji
.ds Jf OlDnDSitePreviewHints
.JF OlDnDDropSiteID  \f2dropsiteid\fP,
.JF Widget   *\f2widget\fP,
.JF Window   *\f2window\fP,
.JF OlDnDSitePreviewHints *\f2preview_hints\fP,  
.JF OlDnDSiteRectPtr  *\f2site_rects\fP,  
.JF "unsigned int"    *\f2num_rects\fP,
.JF Boolean    *\f2on_interest\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDQueryDropSiteInfo 
function retrieves information about a particular drop site. The function returns
.JL TRUE
if the query was successful.  Otherwise it returns
.JL FALSE .
.fi
.JR
.RS
.HP
.I "dropsiteid"
is the id of the drop site to be queried.
.HP
.I "widget" 
is the address of a variable of type
.JL Widget which returns the drop site owner's widget id.  If no query on the widget id is required, set it to
.JL NULL .
For drop sites registered on windows, this parameter is the id of the most immediate window ancestor associated with a widget.
.HP	
.I "window"
is the address of a variable of type Window which returns the id of the window that owns the drop site.  Set this parameter to
.JL NULL
if no query on the window id is required. For gadgets, this is the window id of its windowed ancestor.
.HP	
.I "hints"
is the address of a variable of type
.JL OlDnDSitePreviewHints
which returns the current hints for the drop site.  Set this parameter to
.JL NULL
if no query on the preview hints is required.
.HP	
.I "site_rects"
is the address of a variable of type
.Jl OlDnDSiteRectPtr
which returns a pointer to an array that contains the current geometry of the drop site. This parameter may be set to
.JL NULL
if no query on the site geometry is required.  Clients must use
.Jx XtFree()
to deallocate the memory used by the array when they no longer require it. 
.HP	
.I "num_rects"
is the address of an  unsigned int variable that returns the number of .JL OlSiteRect structures
specified for the drop site.  Set this parameter to
.JL NULL if no query on the number of rectangles in the site geometry is required. It must be non-
.JL NULL "" non-
if the site_rects parameter is
.JL NULL . non-
.#
.#
.SS OlDnDGetWidgetOfDropSite
.IX "OlDnDGetWidgetOfDropSite" "" "\fLOlDnDGetWidgetOfDropSite\fP" "" PAGE MAJOR
.IX "dynamic settings utilities" "OlDnDGetWidgetOfDropSite" "" "\fLOlDragAndDrop\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Widget OlDnDGetWidgetOfDropSite(
.in \n(Ji
.ds Jf OlDnDDropSiteID
.JF OlDnDDropSiteID   \fIdropsiteid\fP);
.JR
.in
.fi
.LP
The
.JL OlDnDGetWidgetOfDropSite
function returns the id of the widget associated with a drop site. If the drop site was registered with
.Jl OlDnDRegisterWindowDropSite() ,
.Jl OlDnDGetWidgetOfDropSite
returns the id of the widget that is the most immediate ancestor of the associated window.
.fi
.JR
.RS
.HP
.I "dropsiteid"
is the id of the drop site.
.#
.#
.SS OlDnDGet-WindowOfDropSite
.IX "OlDnDGetWindowOfDropSite" "" "\fOlDnDGetWindowOfDropSite\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDGetWindowOfDropSite" "" "\fLOlDnDGetWindowOfDropSite\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Window OlDnDGetWindowOfDropSite(
.in \n(Ji
.ds Jf OlDnDDropSiteID
.JF OlDnDDropSiteID   \fIdropsiteid\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDGetWindowOfDropSite
function returns the window id that the drop site was associated with. If the drop site was registered with a gadget then
.JL OlDnDGetWindowOfDropSite
returns the window id of the gadget's windowed parent.
.fi
.JR
.RS
.HP
.I "dropsiteid"
is the id of the drop site.
.#
.#
.SS OlDnDGetDrop-SitesOfWidget
.IX "OlDnDGetDropSitesOfWidget" "" "\fOlDnDGetDropSitesOfWidget\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDGetDropSitesOfWidget" "" "\fLOlDnDGetDropSitesOfWidget\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
OlDnDDropSiteID *OlDnDGetDropSitesOfWidget(
.in \n(Ji
.ds Jf Cardinal
.JF Widget  \f2widget\fP,
.JR
.in
.fi
.LP
The 
.JL OlDnDGetDropSitesOfWidget 
obtains the currently registered list of drop sites for a particular widget instance. The function returns a pointer to an OlDnDDropSiteID array that is an enumeration of the drop sites currently registered for the widget. Clients should use
.Jx XtFree()
on this return value  to deallocate the array when it is no longer needed.  If there are no drop sites registered or the function fails, OlDnDGetDropSitesOfWidget returns NULL.
.fi
.JR
.RS
.HP
.I "widget"
is the widget id
.HP
.I "num_sites"
is the address of a variable of type
.JL Cardinal .
This variable returns the number of currently registered drop sites for the widget.  The number of currently registered drop sites is the same as the number of elements in the array pointed to by the function return value.
.#
.#
.SS OlDnDGetDrop-SitesOfWindow
.IX "OlDnDGetDropSitesOfWindow" "" "\fOlDnDGetDropSitesOfWindow\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDGetDropSitesOfWindow" "" "\fLOlDnDGetDropSitesOfWindow\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
OlDnDDropSiteID *OlDnDGetDropSitesOfWindow(
.in \n(Ji
.ds Jf Cardinal
.JF Window  \f2window\fP,
.JR
.in
.fi
.LP
The 
.JL OlDnDGetDropSitesOfWindow
function obtains the currently registered list of drop sites for a particular window. The function returns a pointer to an
.Jl OlDnDDropSiteID
array that is an enumeration of the drop sites currently registered for the window. Clients should use
.Jx XtFree()
on this return value  to deallocate the array when it is no longer needed.  If there are no drop sites registered or the function fails, .JL OlDnDGetDropSitesOfWindow
returns
.JL NULL .
.fi
.JR
.RS
.HP
.I "window"
is the window id
.HP
.I "num_sites"
is the address of a variable of type
.JL Cardinal
which returns the number of currently registered drop sites for this window.  The number of currently registered drop sites is the same as the number of elements in the array pointed to by the function return value.
.#
.SH THE DRAG AND DROP OPERATION
The drag and drop operation consists of several stages, each of which has a set of associated functions in the OLIT API. The stages are:
.IP \(em 1.5P
asserting ownership of a selection for the data transfer
.IP \(em 1.5P
grabbing the cursor for animation
.IP \(em 1.5P
initializing the drag state
.IP \(em 1.5P
processing the drag events and previewing
.IP \(em 1.5P
delivering the trigger or drop message
.IP \(em 1.5P
handling the X selection transaction to transfer the data
.IP \(em 1.5P
tidying up the drag, freeing the cursor grab and clearing the selection.
.SH USING SELECTIONS WITH DRAG AND DROP
.LP
To obscure protocol implementation from the application developer, the Drag and Drop API, includes a number of special wrapper functions around the normal Xt Selection package to handle this underlying protocol. The developer must be aware that use of these interfaces to the drag and drop selection is essential to ensure proper operation of the selection transfer.
.#
.#
.SS OlDnDOwnSelection
.IX "OlDnDOwnSelection" "" "\fOlDnDOwnSelection\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDOwnSelection" "" "\fLOlDnDOwnSelection\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDOwnSelection(
.in \n(Ji
.ds Jf OlDnDTransactionStateCallback
.JF Widget     \f2widget\fP,
.JF Atom      \f2selection\fP,
.JF Time      \f2timestamp\fP,
.JF XtConvertSelectionProc   \f2convert_proc\fP,
.JF XtLoseSelectionProc   \f2lose_proc\fP,
.JF XtSelectionDoneProc   \f2done_proc\fP,
.JF OlDnDTransactionStateCallback  \f2state_cb\fP,
.JF XtPointer      \f2closure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDOwnSelection
procedure is identical in semantics to the Xt function
.Jx XtOwnSelection()
except for the additional parameter
.I state_cb
(see
.JL OlDnDTransactionStateCallback
above).
.#
.#
.SS OlDnDOwn-SelectionIncremental
.IX "OlDnDOwnSelectionIncremental" "" "\fOlDnDOwnSelectionIncremental\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDOwnSelectionIncremental" "" "\fLOlDnDOwnSelectionIncremental\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDOwnSelectionIncremental(
.in \n(Ji
.ds Jf OlDnDTransactionStateCallback
.JF Widget     \f2widget\fP,
.JF Atom      \f2selection\fP,
.JF XtConvertSelectionIncrProc  \f2convert_incr_proc\fP,
.JF XtLoseSelectionIncrProc   \f2lose_incr_proc\fP,
.JF XtSelectionDoneIncrProc   \f2done_incr_proc\fP,
.JF XtCancelConvertSelectionProc  \f2cancel_proc\fP,
.JF XtPointer     \f2client_data\fP,
.JF OlDnDTransactionStateCallback  \f2state_cb\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDOwnSelectionIncremental
function is identical in semantics to the Xt function
.Jx XtOwnSelectionIncremental()
except for the additional parameter
.I state_cb
(see
.JL OlDnDTransactionStateCallback
above).
#
.SS OlDnDDisownSelection
.IX "OlDnDDisownSelection" "" "\fOlDnDDisownSelection\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDisownSelection" "" "\fLOlDnDDisownSelection\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDDisownSelection(
.in \n(Ji
.ds Jf Widget
.JF Widget    \fIwidget\fP,
.JF Atom      \fIselection\fP,
.JF Time      \fItimestamp\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDDisownSelection
function is identical in semantics to the Xt function
.Jx XtDisownSelection() .
.#
.SS OlDnDTransactionStateCallback
.IX "OlDnDTransactionStateCallback" "" "\fLOlDnDTransactionStateCallback\fP"
.LP
The
.JL OlDnDOwnSelection
and
.JL OlDnDOwnSelectionIncremental
functions have a
.JL OlDnDTransactionStateCallback
function pointer as their last parameter. This function is invoked as a result of drag and drop protocol events during the drag and drop selection transaction.
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . .
typedef void OlDnDTransactionStateCallback(
.in \n(Ji
.ds Jf OlDnDTransactionState
.JF  Widget     \fIwidget\fP, 
.JF  Atom     \fIselection\fP, 
.JF  OlDnDTransactionState  \fIstate\fP,
.JF  Time     \fItimestamp\fP);
.JF  XtPointer     \fIclosure\fP);
.JR
.in
.fi
.LP
The
.JL OlDnDTransactionState
structure is defined as:
.JL
.nf
.sp
typedef	enum oldnd_transaction_state {
		OlDnDTransactionBegins,
		OlDnDTransactionEnds,
		OlDnDTransactionDone,
		OlDnDTransactionRequestorError,
		OlDnDTransactionRequestorWindowDeath
} OlDnDTransactionState;

.sp
.fi
.JR
.LP
The callback is invoked with the following
.JL OlDnDTransactionState
values when the requestor of the selection (i.e the drop site) invokes the following functions:
.JL
.IP \(em 1.5P
OlDnDBeginSelectionTransaction() - OlDnDTransactionBegins
.IP \(em 1.5P
OlDnDEndSelectionTransaction() - OlDnDTransactionEnds
.IP \(em 1.5P
OlDnDDragNDropDone() - OlDnDTransactionDone
.JR
.fi
.LP
A requestor may notify the selection holder of an error by calling the .JL OlDnDErrorDuringSelectionTransaction()
function.   This invokes the callback with a state value of 
.JL OlDnDRequestorError .
.LP
If the requesting client is lost during the selection transfer because its window dies, the state callback will be invoked with a state value of
.JL OlDnDTransactionRequestorWindowDeath.
.fi
.JR
.RS
.HP
.I "widget"
is the selection holder.
.HP
.I "selection"
is the selection atom
.HP
.I "state"
is the protocol event that has occurred
.HP
.I "timestamp"
when the event occurred.
.#
.SS OlDnDBegin-SelectionTransaction
.IX "OlDnDBeginSelectionTransaction" "" "\fOlDnDBeginSelectionTransaction\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDBeginSelectionTransaction" "" "\fLOlDnDBeginSelectionTransaction\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDBeginSelectionTransaction(
.in \n(Ji
.ds Jf OlDnDProtocolActionCbP
.JF Widget    \fIwidget\fP,
.JF Atom     \fIselection\fP,
.JF Time     \fItimestamp\fP,
.JF OlDnDProtocolActionCbP  \fIack_action_cb\fP,
.JF XtPointer    \fIclosure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDBeginSelectionTransaction
function is used in conjuction with the
.JL OlDnDEndSelectionTransaction
function to provide a positive handshake indicating a selection transaction.
.LP
.LP
It invokes the selection holder's transaction state callback (specified by the
.JL OlDnDOwnSelection
and
.JL OlDnDOwnSelectionIncremental
functions) with a state parameter of
.JL OlDnDTransactionBegins .
.fi
.JR
.RS
.HP
.I "widget"
is the requesting widget or the drop site owner.
.HP
.I "selection"
the selection atom passed in the trigger notify procedure.
.HP
.I "timestamp"
is the server timestamp for the current time.
.HP
.I "ack_action_cb"
is the callback to notify the requestor that the holder received the begin notification. The
.JL OlDnDTransactionState
parameter takes the value 
.JL OlDnDTransactionBegins .
.HP
.I "closure"
user data passed to
.I ack_action_cb .
.#
.#
.SS OlDnDEndSelectionTransaction
.IX "OlDnDEndSelectionTransaction" "" "\fOlDnDEndSelectionTransaction\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDEndSelectionTransaction" "" "\fLOlDnDEndSelectionTransaction\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDEndSelectionTransaction(
.in \n(Ji
.ds Jf OlDnDProtocolActionCbP
.JF Widget    \fIwidget\fP,
.JF Atom     \fIselection\fP,
.JF Time     \fItimestamp\fP,
.JF OlDnDProtocolActionCbP  \fIack_action_cb\fP,
.JF XtPointer    \fIclosure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDEndSelectionTransaction
function provides a positive handshake between the selection requestor and holder.
.LP
It invokes the selection holders transaction state callback (registered with the
.JL OlDnDOwnSelection
and
.JL OlDnDOwnSelectionIncremental
functions) with a state parameter of
.JL OIDnDSelectionTransactionEnds .
.fi
.JR
.RS
.HP
.I "widget"
is the widget id of the owner of the dropsite.
.HP
.I "selection"
is the selection atom.
.HP
.I "timestamp"
is the current server time.
.HP
.I "ack_action_cb"
is the callback to inform the requestor that the holder has successfully received the end notification. When it is invoked, the OlDnDTransactionState parameter takes the value
.JL OlDnDTransactionEnds .
.HP
.I "closure"
is user data passed to the
.I ack_action_cb .
.#
.#
.SS OlDnDErrorDuring-SelectionTransaction
.IX "OlDnDErrorDuringSelectionTransaction" "" "\fOlDnDErrorDuringSelectionTransaction\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDErrorDuringSelectionTransaction" "" "\fLOlDnDErrorDuringSelectionTransaction\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDErrorDuringSelectionTransaction(
.in \n(Ji
.ds Jf OlDnDProtocolActionCbP
.JF Widget    \fIwidget\fP,
.JF Atom     \fIselection\fP,
.JF Time     \fItimestamp\fP,
.JF OlDnDProtocolActionCbP \fIack_action_cb\fP,
.JF XtPointer    \fIclosure\fP);
.JR
.in
.fi
.LP
The 
.JL OlDnDErrorDuringSelectionTransaction
function can be called at any time during the selection transfer by the requestor to inform the selection holder that there is an error. The subsequent behaviour of the holder is undefined by this protocol. 
.JL OlDnDErrorDuringSelectionTransaction
invokes the selection holder's protocol state callback (registered with
.JL OlDnDOwnSelection
or
.JL OlDnDOwnSelectionIncremental )
with a protocol state parameter value of
.JL OlDnDSelectionTransactionError .
.fi
.JR
.RS
.HP
.I "widget"    
is the id of the drop site owner.
.HP
.I "selection"
is the selection atom for the transaction.
.HP
.I "timestamp"
is the current server time.
.HP
.I "ack_action_cb"
is the callback to inform the requestor that the selection holder has successfully received the error notification. When it is invoked the OlDnDTransactionState paramater takes the value OlDnDTransactionError.
.HP
.I "closure"
is user data passed to ack_action_cb.
.#
.#
.SS OlDnDProtocolActionCbP
.IX "OlDnDProtocolActionCbP" "" "\fOlDnDErrorDuringSelectionTransaction\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDProtocolActionCbP" "" "\fLOlDnDProtocolActionCbP\fP"
.IP Synopsis:
.LP
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . .
typedef	OlDnDProtocolActionCallbackProc	(*OlDnDProtocolActionCbP)(
.in \n(Ji
.ds Jf OlDnDProtocolAction
.JF Widget   \fIwidget\fP,
.JF Atom   \fIselection\fP,
.JF OlDnDProtocolAction \fIaction\fP,
.JF Boolean   \fIack_ok\fP,
.JF XtPointer   \fIclosure\fP);
.JR
.in
.fi

.LP
The 
.JL OlDnDProtocolActionCbP 
function prototype describes the callback function called when a selection holder acknowledges the receipt of a protocol message generated by the requestor functions:
.JL
.IP \(em 1.5P
OlDnDBeginSelectionTransaction()
.IP \(em 1.5P
OlDnDEndSelectionTransaction()
.IP \(em 1.5P
OlDnDErrrorDuringSelectionTransaction()
.IP \(em 1.5P
OlDnDDragNDropDone()
.fi
.JR
.RS
.HP
.I "widget"
is the id of the drop site owner.
.HP
.I "selection"
is the selection atom.
.HP
.I "timestamp"
is the current server time.
.HP
.I "ack_ok"
specifies whether or not the holder acknowledged the action.
.HP
.I "closure"
is user data.
.#
.#
.#
.#
.SH DELIVERING PREVIEW MESSAGES
.LP
During the drag and drop operation, both the source and potential destinations of the drag and drop operation may want to provide the user with some dynamic visual feedback of some aspect of the drag and drop operation.
For example, a file manager application could change the file folder icon state when a drop cursor crosses it to signify that files can be placed in that folder via drop.
The drag and drop cursor could change state when it is over a sensitive area for drops.
To do this, the drag source must deliver "preview" events to drop sites as the drag operation progresses.
For this purpose, a special client, called the drop site database manager, monitors the state of the drop sites on the screen and provides this information to the drag source client.
The DSDM must be running, for previewing to take place.
.#
.#
.SS OlDnDDeliverPreviewMessage
.IX "OlDnDDeliverPreviewMessage" "" "\fOlDnDDeliverPreviewMessage\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDeliverPreviewMessage" "" "\fLOlDnDDeliverPreviewMessage\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDDeliverPreviewMessage(
.in \n(Ji
.ds Jf Position
.JF Widget   \f2widget\fP,
.JF Window   \f2root\fP,
.JF Position   \f2root_x\fP,
.JF Position   \f2root_y\fP,
.JF Time    \f2timestamp\fP);
.JR
.in
.fi
.LP 
.JL OlDnDDeliverPreviewMessage 
attempts to deliver Enter, Leave and Motion events to any drop sites currently under the (root_x, root_y) position on the root window specified. To preview drop sites, the DSDM (DropSite Database Manager) client must be running in order to provide the source client with up-to-date drop site information. 
.LP
The function returns TRUE if it finds a drop site to deliver an event to.  Otherwise it returns FALSE.

.fi
.JR
.RS
.HP	
.I "widget"
is the DnD Selection owner widget id.
.HP	
.I "root"
is the root window id.
.HP	
.I "root_x"
is the root-relative x screen co-ordinate at which OlDnDDeliverPreviewMessage attempts to preview delivery.
.HP	
.I "root_y"
is the root-relative y screen co-ordinate at which OlDnDDeliverPreviewMessage attempts to preview delivery.
.HP	
.I "timestamp"
is the current server time.
.SS OlDnDDragAndDrop
.IX "OlDnDDragAndDrop" "" "\fOlDnDDragAndDrop\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDragAndDrop" "" "\fLOlDnDDragAndDrop\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDDragAndDrop(
.in \n(Ji
.ds Jf Position
.JF Widget    \f2widget\fP,
.JF Window    *\f2window\fP,
.JF Position    *\f2x\fP,
.JF Position    *\f2y\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDDragAndDrop 
function provides a simple interface for processing the mouse and keyboard events during a drop and drop operation. Before calling this function, you should call OlGrabDragCursor or XGrabPointer to effectively grab pointer events.  
.br
.br
OlDnDDragAndDrop issues an XGrabKeyboard to obtain keystrokes during the drag operation. It then inserts a raw event handler on the widget specified for the pointer and key events and initializes the drag and drop system with OlDnDInitializeDragState. Then it proceeds to process the event stream, delivering preview messages where appropriate via OlDnDDeliverPreviewMessage until the drag completes or is aborted. The function returns the x, y location and the window that the pointer was in when the operation completed.  It also returns the necessary root information.
.fi
.JR
.RS
.HP	
.I "widget"
is the widget id of the selection holder
.HP	
.I "window"
is the address of a variable of type
.JL Window
which returns the window id containing the pointer
.HP	
.I "x"
is the address of a variable of type
.JL Position
which returns the x-location of the pointer relative to the containing window
.HP	
.I "y"
is a pointer to a variable of type
.JL Position
which returns the y-location of the pointer relative to the containing window.
.HP	
.I "root_info"
is a pointer to a variable of type
.JL OlDnDDragNDropInfo
which returns information about the root-relative pointer location.
.JL
.nf
typedef struct	_ol_dnd_root_info {
		Window		root_window;
		Position	root_x;
		Position	root_y;
		Time		drop_timestamp;
		} OlDnDDragNDropInfo, *OlDnDDragNDropInfoPtr;
.JR
.SS OlDnDInitializeDragState
.IX "OlDnDInitializeDragState" "" "\fOlDnDInitializeDragState\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDInitializeDragState" "" "\fOlDnDInitializeDragState\fP"
.IP Synopsis:
.JL
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDInitializeDragState(
.in \n(Ji
.ds Jf Widget
.JF   Widget  \fIwidget\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDInitializeDragState 
function is called prior to commencing delivery of preview messages to cause the drag and drop system to download drop site previewing information from the DSDM. It returns TRUE if the download was successful.  Otherwise it returns FALSE.
.
.fi
.JR
.RS
.HP	
.I "widget"
is the widget id of the selection holder
.HP
.SS OlDnDClearDragState
.IX "OlDnDClearDragState" "" "\fOlDnDClearDragState\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDClearDragState" "" "\fLOlDnDClearDragState\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDClearDragState(
.in \n(Ji
.ds Jf Widget
.JF Widget    \f2widget\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDClearDragState 
function must be called upon completion of the previewing phase of a drag and drop gesture to clear internal state within the drag and drop system.
.fi
.JR
.RS
.HP	
.I "widget"
is the widget id of the selection holder
.HP	

.SH DELIVERING TRIGGER MESSAGES
Once the Drop gesture has occurred, the dragging client must notify the drop site on which the drop gesture occurred, to initiate the X Selection transfer that exchanges the data between the dragging client and the drop target client. 

.SS OlDnDDeliverTriggerMessage
.IX "OlDnDDeliverTriggerMessage" "" "\fOlDnDDeliverTriggerMessage\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDDeliverTriggerMessage" "" "\fLOlDnDDeliverTriggerMessage\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDDeliverTriggerMessage(
.in \n(Ji
.ds Jf OlDnDTriggerOperation
.JF Widget    \f2widget\fP,
.JF Window    \f2root\fP,
.JF Position    \f2root_x\fP,
.JF Position    \f2root_y\fP,
.JF Atom     \f2selection\fP,
.JF OlDnDTriggerOperation  \f2operation\fP,
.JF Time     \f2timestamp\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDDeliverTriggerMessage 
function is called by the dragging client to deliver a trigger message to a target drop site on the root window at the coordinates specified.

The calling client is responsible for establishing a timeout period. If the drop target doesn't send selection conversion requests during this period it should take appropriate action.  OlDnDDeliverTriggerMessage returns TRUE if it finds a drop site to dispatch a trigger message to at the root (x,y).  Otherwise it returns FALSE.
.fi
.JR
.RS
.HP
.I "widget"
is the widget id of the selection holder
.HP
.I "root"
is the root window id
.HP
.I "root_x"
is the root relative x coordinate of the point to which a trigger message should be dispatched
.HP
.I "root_y"
is the root relative y coordinate of the point to which a trigger message should be dispatched
.HP
.I "selection"
is the selection atom that the requestor should use to effect the selection transfer
.HP
.I "operation"
is a trigger operation that copies or moves the selected data.
.HP
.I "time"
is the current server time

.SH DRAG AND DROP CONVENIENCE ROUTINES
Since selection transactions are used extensively throughout this protocol it is necessary to use many atoms that are resources for the lifetime of the server. It is convenient to provide a mechanism to share these atoms.

.SS OlDnDAllocTransientAtom
.IX "OlDnDAllocTransientAtom" "" "\fOlDnDAllocTransientAtom\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDAllocTransientAtom" "" "\fOlDnDAllocTransientAtom\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Atom OlDnDAllocTransientAtom(
.in \n(Ji
.ds Jf Widget
.JF Widget \f2w\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDAllocTransientAtom 
function allocates a reusable "transient" atom suitable for use in a drag and drop selection transaction upon this widget.
.fi
.JR
.RS
.HP
.I "widget"
is the id of the widget about to assert ownership of a selection using the atom returned from this call.

.SS OlDnDFreeTransientAtom
.IX "OlDnDFreeTransientAtom" "" "\fOlDnDFreeTransientAtom\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDFreeTransientAtom" "" "\fOlDnDFreeTransientAtom\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
void OlDnDFreeTransientAtom(
.in \n(Ji
.ds Jf Widget
.JF Widget    \f2widget\fP,
.JF Atom     \f2transient\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDFreeTransientAtom 
function frees the transient atom specified for use by other drop sites.
.fi
.JR
.RS
.HP
.I "widget"
is the widget with which the transient atom was associated.
.HP
.I "transient"
is the selection atom.
.HP

.SS OlDnDGetCurrent-SelectionsForWidget
.IX "OlDnDGetCurrentSelectionsForWidget" "" "\fOlDnDGetCurrentSelectionsForWidget\fP" "" PAGE MAJOR
.IX "drag and drop utilities" "OlDnDGetCurrentSelectionsForWidget" "" "\fOlDnDGetCurrentSelectionsForWidget\fP"
.IP Synopsis:
.JL
.nf
#include <Xol/OpenLook.h>
#include <Xol/OlDnDVCX.h>
 . . . 
Boolean OlDnDGetCurrentSelectionsForWidget(
.in \n(Ji
.ds Jf Cardinal
.JF Widget    \f2widget\fP,
.JF Atom     **\f2atoms\fP,
.JF Cardinal *\f2num_atoms\fP);
.JR
.in
.fi
.LP 
The
.JL OlDnDGetCurrentSelectionsForWidget 
function returns a list of atoms currently held as drag and drop selections for the specified widget. If OlDnDGetCurrentSelectionsForWidget finds any, it returns TRUE.  Otherwise it returns FALSE.

The caller must call XtFree() on the pointer returned in the atom's parameter to free the store allocated when no longer required.
.fi
.JR
.RS
.HP
.I "widget"
is the widget id to be queried.
.I "atoms"
is a pointer to a variable of type Atom * which returns a pointer to an array of atoms that are currently held as selections.
.HP
.I "num_atoms"
is a pointer to a variable of type Cardinal which returns the number of atoms returned.







