XMCLIPBOARDSTARTCOPY(3)
π XmClipboardStartCopy π
okay so bestie, welcome to XmClipboardStartCopy(library call) β yes it's a library call, it lives in the Motif/Xm world, and it is literally the function that sets up a storage and data structure for clipboard shenanigans. she's the opener, the main character, the one who goes first π
β¨ SYNOPSIS β¨
#include <Xm/CutPaste.h>
int XmClipboardStartCopy (display, window, clip_label,
timestamp, widget, callback, item_id)
Display * display;
Window window;
XmString clip_label;
Time timestamp;
Widget widget;
XmCutPasteProc callback;
long * item_id;
(void)
πΈ DESCRIPTION πΈ
So. XmClipboardStartCopy sets up storage and data structures to receive clipboard data. An application calls this function during a cut or copy operation. And the data item that these structures receive? That becomes the next data item in the clipboard. no cap. π
okay but here's the thing bestie β copying a large piece of data to the clipboard can take a long time π. And it's possible that, once the data is copied, no application will ever request that data. like, you did all that work for nobody to look at it. tragic. so the Motif Toolkit provides a mechanism so that an application does not need to actually pass data to the clipboard until the data has been requested by some application. it's giving "lazy but make it efficient." β¨
Instead, the application passes format and length information in XmClipboardCopy to the clipboard functions, along with a widget ID and a callback function address that is passed in XmClipboardStartCopy. The widget ID is necessary for communications between the clipboard functions in the application that owns the data and the clipboard functions in the application that requests the data. it's the group chat between the two apps fr fr π¬
The callback functions are responsible for copying the actual data to the clipboard through XmClipboardCopyByName. The callback function is also called if the data item is removed from the clipboard and the actual data is no longer needed. bye bestie, your data is no longer required π«Ά
displayβ Specifies a pointer to theDisplaystructure that was returned in a previous call toXOpenDisplayorXtDisplay. it's the β¨connectionβ¨, you already have it, just hand it over.windowβ Specifies the window ID of a widget that relates the application window to the clipboard. The widget's window ID can be obtained throughXtWindow. The same application instance should pass the same window ID to each of the clipboard functions that it calls. consistency is the vibe, don't be switching up on her πclip_labelβ Specifies the label to be associated with the data item. This argument is used to identify the data item, as in a clipboard viewer. An example of a label is the name of the application that places the data in the clipboard. it's the little name tag π·οΈ so everyone knows whose data this is.timestampβ Specifies the time of the event that triggered the copy. A valid timestamp must be supplied; it is not sufficient to useCurrentTime. β οΈ like, do not try it. she will know. give her a real timestamp.widgetβ Specifies the ID of the widget that receives messages requesting data previously passed by name. This argument must be present in order to pass data by name. Any valid widget ID in your application can be used for this purpose and all the message handling is taken care of by the cut and paste functions. so you don't have to do the message wrangling yourself, they handle it π§callbackβ Specifies the address of the callback function that is called when the clipboard needs data that was originally passed by name. This is also the callback to receive the delete message for items that were originally passed by name. This argument must be present in order to pass data by name. she's the one who picks up the phone πitem_idβ Specifies the number assigned to this data item. The application uses this number in calls toXmClipboardCopy,XmClipboardEndCopy, andXmClipboardCancelCopy. it's the little ID number so you can find her again later π
For more information on passing data by name, see XmClipboardCopy(3) and XmClipboardCopyByName(3).
The widget and callback arguments must be present in order to pass data by name. The callback format is as follows:
void (*callback) (widget, data_id, private, reason)
Widget widget;
long *data_id;
long *private;
int *reason;
(void)
widgetβ Specifies the ID of the widget passed to this function.data_idβ Specifies the identifying number returned byXmClipboardCopy, which identifies the pass-by-name data.privateβ Specifies the private information passed toXmClipboardCopy.reasonβ Specifies the reason.XmCR_CLIPBOARD_DATA_DELETEorXmCR_CLIPBOARD_DATA_REQUESTare the possible values. only two options, pick one π―
π₯ RETURN π₯
XmClipboardSuccessβ The function was successful. slay!! β¨πXmClipboardLockedβ 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. she's not ghosting you, she's just busy β knock again π
π¦ RELATED π¦
XmClipboardCancelCopy(3), XmClipboardCopy(3), XmClipboardCopyByName(3), XmClipboardEndCopy(3), XmClipboardEndRetrieve(3), XmClipboardInquireCount(3), XmClipboardInquireFormat(3), XmClipboardInquireLength(3), XmClipboardInquirePendingItems(3), XmClipboardLock(3), XmClipboardRegisterFormat(3), XmClipboardRetrieve(3), XmClipboardStartRetrieve(3), XmClipboardUndoCopy(3), XmClipboardUnlock(3), and XmClipboardWithdrawFormat(3).
the whole clipboard friend group honestly π
and that's the page bestie!! this was XmClipboardStartCopy(library call) from the Motif library call crew, and honestly she ate π
mwah, go forth and copy responsibly β¨ππ
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms