XSetState(3)
π¦ XSetState(3) β GC convenience routines π¦
okay so this page is from the XLIB FUNCTIONS manual, and it's giving βfive little GC convenience routines that absolutely carry the group project.β bestie, if you've ever needed to poke at a GC without doing the whole entire thing, this is your moment. π
β¨ NAME β¨
XSetState,XSetFunction,XSetPlaneMask,XSetForeground,XSetBackgroundβ GC convenience routines, periodt. π
πΈ SYNTAX πΈ
int XSetState(Display *display, GC gc, unsigned long foreground,
unsigned long background, int function, unsigned long
plane_mask);
int XSetFunction(Display *display, GC gc, int function);
int XSetPlaneMask(Display *display, GC gc, unsigned long plane_mask);
int XSetForeground(Display *display, GC gc, unsigned long foreground);
int XSetBackground(Display *display, GC gc, unsigned long background);
π ARGUMENTS π
backgroundβ specifies the background you want to set for the specified GC. yes, the background. the vibe behind the vibe.displayβ specifies the connection to the X server. your link to the server, iykyk.foregroundβ specifies the foreground you want to set for the specified GC. the main-character color, lowkey.functionβ specifies the function you want to set for the specified GC. yes, that function.gcβ specifies the GC. short, sweet, no notes.plane_maskβ specifies the plane mask. that's the whole description, bestie, we respect it.
π« DESCRIPTION π«
XSetStateβ sets the foreground, background, plane mask, and function components for the specified GC. iconic multitasking behavior. πXSetStatecan generateBadAlloc,BadGC, andBadValueerrors. not the cute kind of drama. πXSetFunctionsets a specified value in the specified GC. simple, effective, slay.XSetFunctioncan generateBadAlloc,BadGC, andBadValueerrors.XSetPlaneMasksets the plane mask in the specified GC.XSetPlaneMaskcan generateBadAllocandBadGCerrors.XSetForegroundsets the foreground in the specified GC.XSetForegroundcan generateBadAllocandBadGCerrors.XSetBackgroundsets the background in the specified GC.XSetBackgroundcan generateBadAllocandBadGCerrors.
π«Ά DIAGNOSTICS π«Ά
BadAllocβ the server failed to allocate the requested resource or server memory. the server said βno β€οΈβ and honestly? rude.BadGCβ a value for aGContextargument does not name a definedGContext. bestie, that GC is not giving what you think it's giving.BadValueβ some numeric value falls outside the range of values accepted by the request. unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. any argument defined as a set of alternatives can generate this error. so yeah, check your numbers before the server does it for you. π
π SEE ALSO π
XCreateGC(3)XQueryBestSize(3)XSetArcMode(3)XSetClipOrigin(3)XSetFillStyle(3)XSetFont(3)XSetLineAttributes(3)XSetTile(3)Xlib - C Language X Interface
and that's the page, bestie π big sign-off energy: this footer is serving X Version 11 and libX11 1.8.14 β the date line isn't in this one, so I'm absolutely not inventing one, no cap. XSetState(3) out. πβ¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms