#include <Xm/Display.h>
An XmDisplay object is automatically created when the application creates the first shell on a display (usually accomplished by a call to XtAppInitialize or XtAppCreateShell). It is not necessary to create an XmDisplay object by any other means. An application can use the function XmGetXmDisplay to obtain the widget ID of the XmDisplay object for a given display.
An application cannot supply initial values for XmDisplay resources as arguments to a call to any function that creates widgets. The application or user can supply initial values in a resource file. After creating the first shell on the display, the application can use XmGetXmDisplay to obtain the widget ID of the XmDisplay object and then call XtSetValues to set the XmDisplay resources.
XmDisplay resources specify the drag protocol style for a client
participating in drag and drop transactions. There are two basic
protocol types, preregister and dynamic. When a preregister protocol
is used, the toolkit handles any communication between the initiator
and receiver clients, and displays the appropriate drag-over and
drag-under visual effects. A client registers its drop sites in
advance and this information is stored in a property for each
top-level window. When the drag pointer enters a top level window,
the drop site information is read by the initiator. A dynamic
protocol allows the source and destination clients to dynamically
communicate drag and drop state information between each other, and
to update their respective visuals accordingly. The toolkit provides
drop site information as the pointer passes over any given drop site.
In this mode, a receiver can supply a procedure to generate its
own drag-under effects.
The class pointer is xmDisplayClass.
The class name is XmDisplay.
XmDisplay resource set
Name | Class | Type | Default | Access |
---|---|---|---|---|
XmNdefaultVirtualBindings | DefaultVirtualBindings | String | dynamic | CG |
XmNdragInitiatorProtocolStyle | XmCDragInitiatorProtocolStyle | unsigned | char | XmDRAG_PREFER_RECEIVER |
CG | ||||
XmNdragReceiverProtocolStyle | XmCDragReceiverProtocolStyle | unsigned | char | XmDRAG_PREFER_PREREGISTER |
CG |
------------------------------------------------------------------------------------------------------------------- | Name | Class | Type | Default | Access | |------------------------------|-------------------------------|-----------|-----------|---------------------------| | XmNdefaultVirtualBindings | DefaultVirtualBindings | String | dynamic | CG | |------------------------------|-------------------------------|-----------|-----------|---------------------------| | XmNdragInitiatorProtocolStyle| XmCDragInitiatorProtocolStyle| unsigned | char | XmDRAG_PREFER_RECEIVER | |------------------------------|-------------------------------|-----------|-----------|---------------------------| | XmNdragReceiverProtocolStyle | XmCDragReceiverProtocolStyle | unsigned | char | XmDRAG_PREFER_PREREGISTER| |------------------------------|-------------------------------|-----------|-----------|---------------------------|
*defaultVirtualBindings: \ osfBackSpace : <Key>BackSpace \n\ osfInsert : <Key>InsertChar \n\ ... osfDelete : <Key>DeleteChar
The actual protocol used between an initiator and a receiver
is based on the protocol style of the receiver and initiator. The
decision matrix is as follows:
Drag initiator | Drag receiver protocol style | |||
---|---|---|---|---|
protocol style | Preregister | Prefer Preregister | Prefer Dynamic | Dynamic |
Preregister | Preregister | Preregister | Preregister | Drop only |
Prefer Preregister | Preregister | Preregister | Preregister | Dynamic |
Prefer Receiver | Preregister | Preregister | Dynamic | Dynamic |
Prefer Dynamic | Preregister | Dynamic | Dynamic | Dynamic |
Dynamic | Drop only | Dynamic | Dynamic | Dynamic |
------------------------------------------------------------------------------------ | Drag initiator | Drag receiver protocol style | |-------------------|-------------|--------------------|----------------|-----------| | | ------------|--------------------|----------------|-----------| |-------------------|-------------|--------------------|----------------|-----------| | protocol style | Preregister| Prefer Preregister| Prefer Dynamic| Dynamic | |-------------------|-------------|--------------------|----------------|-----------| | Preregister | Preregister| Preregister | Preregister | Drop only| |-------------------|-------------|--------------------|----------------|-----------| | Prefer Preregister| Preregister| Preregister | Preregister | Dynamic | |-------------------|-------------|--------------------|----------------|-----------| | Prefer Receiver | Preregister| Preregister | Dynamic | Dynamic | |-------------------|-------------|--------------------|----------------|-----------| | Prefer Dynamic | Preregister| Dynamic | Dynamic | Dynamic | |-------------------|-------------|--------------------|----------------|-----------| | Dynamic | Drop only | Dynamic | Dynamic | Dynamic | |-------------------|-------------|--------------------|----------------|-----------|The value XmDRAG_NONE does not appear in the above matrix. When specified for either the initiator or receiver side, XmDRAG_NONE implies that drag and drop transactions are not supported. A value of XmDRAG_DROP_ONLY (Drop Only) results when an initiator and receiver cannot compromise protocol styles, that is, one client requires dynamic mode while the other can only support preregister mode, or if either explicitly has specified XmDRAG_DROP_ONLY.