XMCLIPBOARDCOPY(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– XmClipboardCopy πŸ’–

okay so bestie, welcome to the XmClipboardCopy page from the library call section of the manual β€” she's a Motif clipboard function and she's lowkey iconic. sit down, grab a strawberry πŸ“, and let's get you clipboard-literate fr fr.


✨ NAME ✨

XmClipboardCopy β€” a clipboard function that copies a data item to temporary storage for later copying to clipboard πŸŽ€


✨ SYNOPSIS ✨

#include <Xm/CutPaste.h>
int XmClipboardCopy (display, window, item_id, format_name,
        buffer, length, private_id, data_id)
        Display * display;
        Window  window;
        long    item_id;
        char    * format_name;
        XtPointer       buffer;
        unsigned long   length;
        long    private_id;
        long    * data_id;
(void)

✨ DESCRIPTION ✨

XmClipboardCopy copies a data item to temporary storage. the data item gets moved from temporary storage to the clipboard data structure when a call to XmClipboardEndCopy is made. and here's the slay part β€” additional calls to XmClipboardCopy before a call to XmClipboardEndCopy add additional data item formats to the same data item, or append data to an existing format. formats are described in the Inter-Client Communication Conventions Manual (ICCCM) as targets. iykyk πŸ’…

🚨 NOTE, and this one is important bestie: do NOT call XmClipboardCopy before a call to XmClipboardStartCopy has been made. the latter function allocates the temporary storage that XmClipboardCopy literally needs. no setup, no vibes. periodt.

if the buffer argument is NULL, the data is considered to be passed by name. when data that has been passed by name is later requested by another application, the application that owns the data receives a callback with a request for the data. the application that owns the data must then transfer the data to the clipboard with the XmClipboardCopyByName function. and when a data item that was passed by name is deleted from the clipboard, the application that owns the data receives a callback stating that the data is no longer needed. πŸ¦‹

for information on the callback function, see the callback argument description for XmClipboardStartCopy.

  • display β€” specifies a pointer to the Display structure that was returned in a previous call to XOpenDisplay or XtDisplay.
  • window β€” specifies the window ID of a widget that relates the application window to the clipboard. the widget's window ID can be obtained through XtWindow. the same application instance should pass the same window ID to each of the clipboard functions that it calls. consistency is the main character energy here πŸ‘‘
  • item_id β€” specifies the number assigned to this data item. this number was returned by a previous call to XmClipboardStartCopy.
  • format_name β€” specifies the name of the format in which the data item is stored on the clipboard. the format was known as target in the ICCCM.
  • buffer β€” specifies the buffer from which the clipboard copies the data.
  • length β€” specifies the length, in bytes, of the data being copied to the clipboard.
  • private_id β€” specifies the private data that the application wants to store with the data item.
  • data_id β€” specifies an identifying number assigned to the data item that uniquely identifies the data item and the format. this argument is required only for data that is passed by name. πŸ’œ

✨ RETURN ✨

here's the vibe check on what she hands back to you:

  • XmClipboardSuccess β€” the function was successful. we ate. πŸ”₯
  • 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. (patience is a virtue bestie 😭)
  • XmClipboardFail β€” the function failed because XmClipboardStartCopy was not called or because the data item contains too many formats. πŸ’€

go read these next, they're the besties in the same group chat:


okay that's the whole page, no notes, you understood all of it 🌈✨. this was XmClipboardCopy from the library call section β€” the manual doesn't hand us a version number or a date on this one, so just take the title, the source, and the date as whatever your system's manual stamps on it, mwah 🫢. now go copy something to a clipboard and be iconic about it. bye bestie! πŸŽ€πŸ’–πŸŒΈ