XMCLIPBOARDREGISTERFORMAT(3)
π XmClipboardRegisterFormat π
okay so bestie, welcome to XmClipboardRegisterFormat β a lil library call from the Xm clipboard universe that registers a brand new format. yes, the manual name is literally "library call," she's a C function, she lives in a header, and she's here to make sure your clipboard data doesn't get its bytes scrambled the second it hops platforms. iconic behavior honestly.
β¨ NAME β¨
XmClipboardRegisterFormat β a clipboard function that registers a new format π
πΈ SYNOPSIS πΈ
#include <Xm/CutPaste.h>
int XmClipboardRegisterFormat (display, format_name, format_length)
Display * display;
char * format_name;
int format_length;
(void)
π¦ DESCRIPTION π¦
so XmClipboardRegisterFormat registers a new format. periodt. π
every single format stored on the clipboard should have a length attached to it, and that length must be known to the clipboard routines. like, no length, no service. and here's the fun lore: formats are known as targets in the Inter-Client Communication Conventions Manual, aka the ICCCM (iykyk). π
now the tea: all of the formats specified by version 1.1 of the ICCCM conventions are preregistered. already done, no notes, they came ready. but any other format your app wants to use has to either be:
- 8-bit data, or
- registered via this routine (hi, that's what we're doing here π)
bestie listen π if you fail to register the length of the data, the result is incompatible applications across platforms having different byte-swapping orders. that's not a vibe. that's a disaster. register the length.
and here are the args, mwah:
displayβ a pointer to theDisplaystructure that was returned in a previous call toXOpenDisplayorXtDisplay. she's already been introduced, don't be weird about it.format_nameβ the string name for the new format (the target). yes, a string, a whole name, slay.format_lengthβ the format length in bits, and it's gotta be8,16, or32. those are the only options, don't try to be different π«Ά
π RETURN π
the function hands you back one of these, and each one has a whole personality:
XmClipboardBadFormatβformat_namemust not beNULL, andformat_lengthmust be8,16, or32. that's the rule, that's the boundary, respect it. πXmClipboardSuccessβ the function was successful. we ate. π₯XmClipboardLockedβ the function failed because the clipboard was locked by another application. okay so the move here is: you can keep calling the function again with the same parameters until the lock goes away. this is actually a gift, because it gives the application the opportunity to ask the user whether they wanna keep trying or just give up on the operation. user choice, main character energy. β¨XmClipboardFailβ the function failed because the specified format was already registered with a different length from the one specified now. and oop β but if a specified format was already registered with the same length as the one specified now, thenXmClipboardSuccessis returned instead. consistency wins. π
π RELATED π
okay that's the whole page, you're so welcome, go register those formats responsibly π§
XmClipboardRegisterFormat(library call) β that's the footer bestie, that's the whole signature of this page, and it's giving library call realness, no cap. bye mwah ππΈπ
π¦ 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