XtGetSelectionParameters(3)

πŸ’– XtGetSelectionParameters β€” the X Toolkit Intrinsics tea πŸ’–

okay bestie, pull up a chair, because we're about to talk about XtGetSelectionParameters, a little function from the XT FUNCTIONS corner of the X world. it grabs the target parameters for a selection request that has a single target. that's it, that's the whole vibe. πŸŽ€


✨ NAME ✨

XtGetSelectionParameters β€” retrieve target parameters for a selection request with a single target πŸ¦‹


✨ SYNTAX ✨

first things first, you gotta invite the header in:

#include <X11/Intrinsic.h>

and here's the actual call, verbatim, no cap:

void XtGetSelectionParameters(Widget owner, Atom selection, XtRequestId
       request_id, Atom *type_return, XtPointer *value_return, unsigned
       long *length_return, int *format_return);

she's long, she's gorgeous, she takes seven arguments. slay. πŸ’…


✨ ARGUMENTS ✨

  • owner β€” the widget that owns the selection we're talking about. it's giving "this is mine, actually". πŸ‘‘
  • selection β€” the selection currently being processed. the one in the hot seat. πŸ”₯
  • request_id β€” the requestor id, but only when we're doing incremental selections. if it's an atomic transfer instead, this is NULL. pick your lane. πŸ™ˆ
  • type_return β€” a pointer to an atom, and that atom is where the property type of the parameters gets stored. ✨
  • value_return β€” a pointer to a pointer, and the parameters land in there. if no parameters come with the request, a NULL gets stored instead. no parameters, no problem. 🫢
  • length_return β€” a pointer where the number of data elements in value_return gets stored β€” and those elements are sized according to whatever format_return says. teamwork, fr fr. 🌈
  • format_return β€” a pointer where the size in bits of the parameter data inside the elements of value_return gets stored. it's giving "the units matter, bestie". ⭐

✨ DESCRIPTION ✨

okay so here's the thing you absolutely cannot skip, and I mean it:

XtGetSelectionParameters may only be called from inside an XtConvertSelectionProc, or from inside the last call to an XtConvertSelectionIncrProc with a new request_id.

that's the rule. not "usually", not "preferably" β€” only. call it from anywhere else and you're on your own, bestie. 😭 so if you're in an XtConvertSelectionProc, go off. if you're in an XtConvertSelectionIncrProc, wait until the last call, and make sure the request_id is a new one. that's the moment. that's your main character moment. πŸ’–


✨ SEE ALSO ✨

go read these next, iykyk:

  • XtSetSelectionParameters(3) β€” the sibling. the other half. πŸŽ€
  • X Toolkit Intrinsics - C Language Interface
  • Xlib - C Language X Interface

and that's the whole page, bestie!! this one's from X Version 11, shipped in libXt 1.3.1. go forth and retrieve those parameters responsibly πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from