PtAddResponseType()

Add data to the response chain

Synopsis:

PhTransportLink_t * 
   PtAddResponseType(
      PtTransportCtrl_t *ctrl,
      PtRequestables_t *requestable,
      char *type,
      char *desc,
      int unsigned transport,
      char *packing_type,
      void *vdata,
      int unsigned vdata_size,
      int unsigned const flags );

Library:

ph

Description:

PtAddResponseType() adds data to the response chain of the transport-control structure pointed to by ctrl. This chain is a queue of data that can be or has been requested by the destination of a drag-and-drop operation.

The source of a drag-and-drop operation can call PtAddResponseType() when it's packing the data to be dragged or when a destination actually requests the data. If a destination has already requested the data, the library automatically sends the data to the destination immediately.

This function searches a list of the data that has already been requested and, if the request for this data has been made, provides the data to the requester.

ctrl
A pointer to the PtTransportCtrl_t structure that controls the drag-and-drop operation.
requestable
A pointer to the description of the requestable data.
type
A descriptive type name, such as image, text, filename, or files. This is simply added to the header for the packed data.
desc
The specifics of what's in the data. The extractor uses a regular-expression match against the description to determine if the data should be unpacked or discarded. This is simply added to the header for the packed data.
transport
The available transport types that can be specified when requesting data from the source:
Ph_TRANSPORT_INLINE
The data being transported is in memory and can be unpacked immediately.
Ph_TRANSPORT_FILEREF
The data being transported is in the temporary file(s) named in the inlined data.
Ph_TRANSPORT_SHMEM
The data being transported is in the temporary shared object(s) named in the inlined data.
Ph_TRANSPORT_STREAM
The data being transported will be inlined a small piece at a time.
Ph_TRANSPORT_NAMED_STREAM
The data being transported will be inlined a small piece at a time. The streamed data is named so multiple streams of data can be transferred serially.
Ph_TRANSPORT_FILE_STREAM
The contents of files streamed using extended named streams. This is like the named stream but with extra information with each data block, including file information and so on. The requester of data must choose one of the available request transport types when requesting delivery of additional data.
packing_type
The packing method to be used (Ph_PACK_RAW, Ph_PACK_STRING, or Ph_PACK_STRUCT).
vdata
A pointer to the data to be transported.
vdata_size
The size of the data pointed to by vdata.
flags
Flags that affect the operation:

Returns:

A pointer to the PhTransportLink_t structure containing the data just added, or NULL if there isn't enough memory.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PhTransportLink_t, PtTransportCtrl_t, PtTransportRequestable(), PtTransportType()

Drag and Drop chapter of the Photon Programmer's Guide