The StringTransfer widget class
Format
#include <Exm/StringTrans.h>
DESCRIPTION
ExmStringTransfer is a demonstration widget. OSF provides this widget solely to teach programmers how to write their own Motif widgets. OSF does not support this widget in any way.
ExmStringTransfer is a subclass of ExmString. ExmStringTransfer inherits all the visuals of ExmString; therefore, ExmStringTransfer displays one compound string. Unlike ExmString, ExmStringTransfer supports data transfer. That is, a user can transfer data into or out of an ExmStringTransfer widget. In fact, the purpose of this widget is to demonstrate how to implement UTM data transfer in a widget.
ExmStringTransfer is an instantiable widget and can also used as a superclass for other widgets.
The ExmStringTransfer class installs the XmQTtransfer trait and implements this trait's convertProc and destinationProc trait methods.
ExmStringTransfer supports two callbacks:
ExmStringTransfer can be the source or destination of a primary, clipboard, or drag and drop transfer. ExmStringTransfer does not support secondary transfers.
Unlike more sophisticated widgets such as XmText, a user cannot copy selected portions of an ExmStringTransfer. Instead, a user can only copy the entire compound string held by ExmNcompoundString, not a subset of it. Similarly, when an ExmStringTransfer is the destination, any text copied into it will overwrite all of the previous contents.
As a source of data, ExmStringTransfer supports the following targets and associated conversions of data to these targets:
As a source of data, ExmStringTransfer also supports the following standard Motif targets:
As a destination for data, when ExmStringTransfer receives data that can be converted to a compound string, it sets ExmNcompoundString to the transferred compound string.
As a destination, ExmStringTransfer chooses a target and requests conversion of the selection to that target. If the encoding of the locale is present in the list of available targets, ExmStringTransfer chooses a requested target from the available targets in the following order of preference:
If the encoding of the locale is not present in the list of available targets, ExmStringTransfer chooses a requested target from the available targets in the following order of preference:
ExmStringTransfer inherits behavior and resources from Core, XmPrimitive, ExmSimple, and ExmString.
The class pointer is exmStringTransferWidgetClass.
The class name is ExmStringTransfer.
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file, remove the XmN, ExmN, XmC or ExmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file, remove the Xm or Exm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The codes in the "Access" column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using XtGetValues (G), or is not applicable (N/A).
ExmStringTransfer Resource Set | ||||
Name | Class | Type | Default | Access |
XmNdestinationCallback | XmCCallback | XtCallbackList | NULL | C |
ExmStringTransfer inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the reference page for that superclass.
ExmString Resource Set | ||||
Name | Class | Type | Default | Access |
ExmNcompoundString | ExmCCompoundString | XmString | NULL | CSG |
XmNalignment | XmCAlignment | unsigned char | XmALIGNMENT_CENTER | CSG |
XmNrecomputeSize | XmCRecomputeSize | Boolean | True | CSG |
XmNrenderTable | XmCRenderTable | XmRenderTable | dynamic | CSG |
ExmSimple Resource Set | ||||
Name | Class | Type | Default | Access |
ExmNsimpleShape | ExmCSimpleShape | unsigned char | ExmSHAPE_OVAL | CSG |
XmNmarginHeight | XmCMarginHeight | Dimension | 4 | CSG |
XmNmarginWidth | XmCMarginWidth | Dimension | 4 | CSG |
XmPrimitive Resource Set | ||||
Name | Class | Type | Default | Access |
XmNbottomShadowColor | XmCBottomShadowColor | Pixel | dynamic | CSG |
XmNbottomShadowPixmap | XmCBottomShadowPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNconvertCallback | XmCCallback | XtCallbackList | NULL | C |
XmNforeground | XmCForeground | Pixel | dynamic | CSG |
XmNhelpCallback | XmCCallback | XtCallbackList | NULL | C |
XmNhighlightColor | XmCHighlightColor | Pixel | dynamic | CSG |
XmNhighlightOnEnter | XmCHighlightOnEnter | Boolean | False | CSG |
XmNhighlightPixmap | XmCHighlightPixmap | Pixmap | dynamic | CSG |
XmNhighlightThickness | XmCHighlightThickness | Dimension | 2 | CSG |
XmNlayoutDirection | XmCLayoutDirection | XmDirection | dynamic | CG |
XmNnavigationType | XmCNavigationType | XmNavigationType | XmNONE | CSG |
XmNpopupHandlerCallback | XmCCallback | XtCallbackList | NULL | C |
XmNshadowThickness | XmCShadowThickness | Dimension | 2 | CSG |
XmNtopShadowColor | XmCTopShadowColor | Pixel | dynamic | CSG |
XmNtopShadowPixmap | XmCTopShadowPixmap | Pixmap | dynamic | CSG |
XmNtraversalOn | XmCTraversalOn | Boolean | True | CSG |
XmNunitType | XmCUnitType | unsigned char | dynamic | CSG |
XmNuserData | XmCUserData | XtPointer | NULL | CSG |
Core Resource Set | ||||
Name | Class | Type | Default | Access |
XmNaccelerators | XmCAccelerators | XtAccelerators | dynamic | CSG |
XmNancestorSensitive | XmCSensitive | Boolean | dynamic | G |
XmNbackground | XmCBackground | Pixel | dynamic | CSG |
XmNbackgroundPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderColor | XmCBorderColor | Pixel | XtDefaultForeground | CSG |
XmNborderPixmap | XmCPixmap | Pixmap | XmUNSPECIFIED_PIXMAP | CSG |
XmNborderWidth | XmCBorderWidth | Dimension | 0 | CSG |
XmNcolormap | XmCColormap | Colormap | dynamic | CG |
XmNdepth | XmCDepth | int | dynamic | CG |
XmNdestroyCallback | XmCCallback | XtCallbackList | NULL | C |
XmNheight | XmCHeight | Dimension | dynamic | CSG |
XmNinitialResourcesPersistent | XmCInitialResourcesPersistent | Boolean | True | C |
XmNmappedWhenManaged | XmCMappedWhenManaged | Boolean | True | CSG |
XmNscreen | XmCScreen | Screen * | dynamic | CG |
XmNsensitive | XmCSensitive | Boolean | True | CSG |
XmNtranslations | XmCTranslations | XtTranslations | dynamic | CSG |
XmNwidth | XmCWidth | Dimension | dynamic | CSG |
XmNx | XmCPosition | Position | 0 | CSG |
XmNy | XmCPosition | Position | 0 | CSG |
A pointer to the following callback structure is passed to the XmNdestinationCallback procedures:
typedef struct { int reason; XEvent * event; Atom selection; XtEnum operation; int flags; XtPointer transfer_id; XtPointer destination_data; XtPointer location_data; Time time; } XmDestinationCallbackStruct;
ExmStringTransfer provides the following translations:
All the actions that begin with the Primitive prefix are defined by the XmPrimitive widget. (See the XmPrimitive(3) reference page of the Motif Programmer's Reference for details.) The actions defined by ExmStringTransfer are as follows:
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3).
RELATED
Core(3), ExmSimple(3), ExmString(3), XmPrimitive(3), and XmQTtransfer(3).