MCPcopy Create free account
hub / github.com/NetHack/NetHack / set_gc

Function set_gc

win/X11/winmap.c:910–936  ·  view source on GitHub ↗

* Fill in parameters "regular" and "inverse" with newly created GCs. * Using the given background pixel and the foreground pixel obtained * by querying the widget with the resource name. */

Source from the content-addressed store, hash-verified

908 * by querying the widget with the resource name.
909 */
910static void
911set_gc(
912 Widget w,
913 Font font,
914 const char *resource_name,
915 Pixel bgpixel,
916 GC *regular, GC *inverse)
917{
918 XGCValues values;
919 XtGCMask mask = GCFunction | GCForeground | GCBackground | GCFont;
920 Pixel curpixel;
921 Arg arg[1];
922
923 XtSetArg(arg[0], (char *) resource_name, &curpixel);
924 XtGetValues(w, arg, ONE);
925
926 values.foreground = curpixel;
927 values.background = bgpixel;
928 values.function = GXcopy;
929 values.font = font;
930 *regular = XtGetGC(w, mask, &values);
931 values.foreground = bgpixel;
932 values.background = curpixel;
933 values.function = GXcopy;
934 values.font = font;
935 *inverse = XtGetGC(w, mask, &values);
936}
937
938/*
939 * Create the GC's for each color.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected