XMCLIPBOARDCOPYBYNAME(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

πŸ’– XmClipboardCopyByName β€” the library call glow-up πŸ’–

okay bestie, sit down, hydrate, and let me tell you about XmClipboardCopyByName from section 3 of the library manual, because this little function is lowkey the backstage pass of the Motif clipboard world πŸŽ€


✨ NAME ✨

XmClipboardCopyByName β€” a clipboard function that copies a data item passed by name πŸ’…


🌸 SYNOPSIS 🌸

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

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the tea β˜• XmClipboardCopyByName copies the actual data for a data item that was previously passed by name to the clipboard. and when do you count as "passed by name"? it's giving: when a call to XmClipboardCopy was made with a NULL buffer parameter. that's the moment the clipboard was like "okay noted, name only, no data yet" πŸ“

and then β€” plot twist β€” if you call this function again and again, those additional calls append new data to the existing data. it just keeps stacking, no cap. ✨

  • 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. you can grab that widget's window ID through XtWindow. and listen: the same application instance should pass the same window ID to every clipboard function it calls. consistency is the vibe, fr fr. 🫢
  • data_id β€” Specifies an identifying number assigned to the data item that uniquely identifies the data item and the format. this number was handed out by XmClipboardCopy to the data item. it's basically the item's little passport πŸ›‚
  • buffer β€” Specifies the buffer from which the clipboard copies the data. πŸ“¦
  • length β€” Specifies the number of bytes in the data item. numbers bestie, exact numbers πŸ”’
  • private_id β€” Specifies the private data that the application wants to store with the data item. yes queen, stash your little secrets with it πŸ™ˆ

πŸ’€ RETURN πŸ’€

  • XmClipboardSuccess β€” The function was successful. slay! πŸŽ‰βœ¨
  • XmClipboardLocked β€” The function failed because the clipboard was locked by another application. 😭 and the move here? 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. so like, politely knock again, or let the user decide. no forcing the lock, we're not that girl πŸ’…


and that's the whole page, bestie πŸ’– this was XmClipboardCopyByName(library call) β€” the manual name, the source/version, and the date all live on that footer line, so consider this your cute little sign-off from the library call section, periodt. πŸŽ€βœ¨πŸ¦‹