<!-- $XConsortium: ClipbL.sgm /main/10 1996/09/25 10:24:57 cdedoc $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->

<RefEntry Id="CDEMMA.MAN97.rsml.1">
<RefMeta>
<RefEntryTitle>XmClipboardRetrieve</RefEntryTitle>
<ManVolNum>library call</ManVolNum>
</RefMeta>
<RefNameDiv>
<RefName><Function>XmClipboardRetrieve</Function></RefName>
<RefPurpose>A clipboard function that retrieves a data item from the clipboard
<IndexTerm>
<Primary>XmClipboardRetrieve</Primary>
</IndexTerm><IndexTerm>
<Primary>clipboard functions</Primary>
<Secondary>XmClipboardRetrieve</Secondary>
</IndexTerm></RefPurpose>
</RefNameDiv>
<!-- -->
<!-- @OSF_COPYRIGHT@-->
<!-- COPYRIGHT NOTICE-->
<!-- Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.-->
<!-- ALL RIGHTS RESERVED (MOTIF). See the file named COPY.MOTIF.DOC for-->
<!-- the full copyright text.-->
<!-- -->
<!-- HISTORY-->
<!-- -->
<!-- **-->
<!-- **-->
<!-- **  (c) Copyright 1989, 1990, 1992 by Open Software Foundation, Inc.-->
<!-- **      All Rights Reserved.-->
<!-- **-->
<!-- **  (c) Copyright 1987, 1988, 1989, by Hewlett-Packard Company-->
<!-- **-->
<!-- **  (c) Copyright 1988 by Massachusetts Institute of Technology-->
<!-- **-->
<!-- **  (c) Copyright 1987, 1988 by Digital Equipment Corporation,-->
<!-- **      Maynard, MA.  All Rights Reserved.-->
<!-- **-->
<!-- **-->
<RefSynopsisDiv>
<FuncSynopsis>
<FuncSynopsisInfo>#include &lt;Xm/CutPaste.h>
int XmClipboardRetrieve (<Replaceable>display, window, format_name,
        buffer, length, num_bytes, private_id</Replaceable>)
        Display <Replaceable>* display</Replaceable>;
        Window  <Replaceable>window</Replaceable>;
        char    <Replaceable>* format_name</Replaceable>;
        XtPointer       <Replaceable>buffer</Replaceable>;
        unsigned long   <Replaceable>length</Replaceable>;
        unsigned long   <Replaceable>* num_bytes</Replaceable>;
        long    <Replaceable>* private_id</Replaceable>;
</FuncSynopsisInfo>
<FuncDef></FuncDef>
<void>
</FuncSynopsis>
</RefSynopsisDiv>
<RefSect1>
<Title>DESCRIPTION</Title>
<Para><Function>XmClipboardRetrieve</Function> retrieves the current data item from clipboard
storage. It returns a warning if the clipboard is locked, if there is
no data on the clipboard, or if the data needs to be truncated because the
buffer length is too short.
</Para>
<Para>Between a call
to <Function>XmClipboardStartRetrieve</Function> and a call to <Function>XmClipboardEndRetrieve</Function>,
multiple calls to <Function>XmClipboardRetrieve</Function>
with the same format name result
in data being incrementally copied from the clipboard until the data in that
format has all been copied.
</Para>
<Para>The return value <Symbol>XmClipboardTruncate</Symbol> from calls to
<Function>XmClipboardRetrieve</Function> indicates that more data remains to be copied in the
given format.
It is recommended that any calls to the <Literal>Inquire</Literal> functions that
the application needs to make to effect the copy from the clipboard be
made between the call to <Function>XmClipboardStartRetrieve</Function> and the first
call to <Function>XmClipboardRetrieve</Function>. This way, the application does not
need to call <Function>XmClipboardLock</Function> and <Function>XmClipboardUnlock</Function>.
</Para>
<VariableList>
<VarListEntry>
<Term><Symbol Role="Variable">display</Symbol></Term>
<ListItem>
<Para>Specifies a pointer to the <StructName Role="typedef">Display</StructName> structure that was returned in a
previous call to <Function>XOpenDisplay</Function> or <Function>XtDisplay</Function>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">window</Symbol></Term>
<ListItem>
<Para>Specifies the window ID of a widget that relates the application window to the
clipboard. The widget's window ID can be obtained through
<Function>XtWindow</Function>.
The same application instance should pass the same window ID to each of the
clipboard functions that it calls.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">format_name</Symbol></Term>
<ListItem>
<Para>Specifies the name of a format in which the data
is stored on the clipboard.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">buffer</Symbol></Term>
<ListItem>
<Para>Specifies the buffer to which the application wants the
clipboard to copy the data.
The function allocates space to hold the data returned into the buffer.
The application is responsible for managing this allocated space.
The application can recover this allocated space by calling <Function>XtFree</Function>.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">length</Symbol></Term>
<ListItem>
<Para>Specifies the length of the application buffer.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">num_bytes</Symbol></Term>
<ListItem>
<Para>Specifies the number of bytes of data copied into the application
buffer.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol Role="Variable">private_id</Symbol></Term>
<ListItem>
<Para>Specifies the private data stored with the data item by the
application that placed the data item on the clipboard. If the
application did not store private data with the data item, this
argument returns 0 (zero).
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>RETURN</Title>
<VariableList>
<VarListEntry>
<Term><Symbol>XmClipboardSuccess</Symbol></Term>
<ListItem>
<Para>The function was successful.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>XmClipboardLocked</Symbol></Term>
<ListItem>
<Para>The function failed because the clipboard was locked by another
application. The application can continue to call the function again with
the same parameters until the lock goes away. This gives the application
the opportunity to ask if the user wants to keep trying or to give up
on the operation.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>XmClipboardTruncate</Symbol></Term>
<ListItem>
<Para>The data returned is truncated because the user did not provide a buffer
large enough to hold the data.
</Para>
</ListItem>
</VarListEntry>
<VarListEntry>
<Term><Symbol>XmClipboardNoData</Symbol></Term>
<ListItem>
<Para>The function could not find data on the clipboard corresponding to the
format requested. This could occur because the clipboard is empty;
there is data on the clipboard but not in the requested format; or the
data in the requested format was passed by name and is no longer
available.
</Para>
</ListItem>
</VarListEntry>
</VariableList>
</RefSect1>
<RefSect1>
<Title>RELATED</Title>
<Para>&cdeman.XmClipboardEndRetrieve;, &cdeman.XmClipboardLock;,
&cdeman.XmClipboardStartCopy;, &cdeman.XmClipboardStartRetrieve;,
and &cdeman.XmClipboardUnlock;.
</Para>
</RefSect1>
</RefEntry>
<!--fickle 1.09 7/2/95-->
