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

πŸ’– XmClipboardCancelCopy πŸ’–

okay bestie, gather round, because this is the library call for when you started something and you're like... nope. not doing this anymore. it's XmClipboardCancelCopy(library call) and she is here to clean up your mess 🧹✨


🌸 NAME 🌸

XmClipboardCancelCopy β€” a clipboard function that cancels a copy to the clipboard. she said "never mind" and meant it πŸ’…


✨ SYNOPSIS ✨

#include <Xm/CutPaste.h>
int XmClipboardCancelCopy (display, window, item_id)
        Display * display;
        Window  window;
        long    item_id;
(void)

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, XmClipboardCancelCopy cancels the copy to clipboard that is in progress and frees up temporary storage. the way this whole saga works is:

when a copy is going to be performed, XmClipboardStartCopy allocates temporary storage for the clipboard data. then XmClipboardCopy copies the appropriate data into the the temporary storage (yes, "the the", that's what the original says, i don't make the rules 🫢). then XmClipboardEndCopy copies the data to the clipboard structure and frees up the temporary storage structures. but here's the thing β€” if XmClipboardCancelCopy is called, the XmClipboardEndCopy function does not have to be called. you're off the hook, girlie πŸŽ€

⚠️ a call to XmClipboardCancelCopy is valid only after a call to XmClipboardStartCopy. don't try to cancel what was never started, it's giving chaos 😭

the parameters, let's go:

  • display β€” Specifies a pointer to the Display structure that was returned in a previous call to XOpenDisplay or XtDisplay. it's literally just your display pointer bestie, hand it over 🫴
  • window β€” Specifies a widget's window ID 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 vibe check here, no cap ⭐
  • item_id β€” Specifies the number assigned to this data item. This number was returned by a previous call to XmClipboardStartCopy. so like, don't invent your own number, use the one she gave you πŸ”₯

πŸ‘‘ RETURN πŸ‘‘

  • XmClipboardSuccess β€” The function was successful. we ate and left no crumbs ✨
  • 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. so basically it's not your fault, someone else is hogging the clipboard, and you get to decide: keep knocking or walk away πŸšͺπŸ’€
  • XmClipboardFail β€” The function failed because XmClipboardStartCopy was not called or because the data item contains too many formats. yeah that's on you, you skipped a step πŸ™ˆ

XmClipboardCopy(3), XmClipboardEndCopy(3), and XmClipboardStartCopy(3). the whole friend group, go read them too πŸ’œ


and that's the whole page, bestie!! thanks for reading all the way to the bottom, you're genuinely the main character 🫢 this was XmClipboardCancelCopy(library call) β€” that's the title up top and the little signature down at the very bottom, cute right? stay iconic, go cancel some copies, and remember: free your temporary storage before it frees you πŸ’–πŸŽ€βœ¨πŸ¦‹πŸŒΈ