From 4ff197f3ec1a643fef506c06ec4d25e5151a3312 Mon Sep 17 00:00:00 2001 From: Aaron Taylor Date: Tue, 8 Jun 2021 19:19:20 -0700 Subject: [PATCH] Updated WolframAutomata's admiration window related flags to match README. --- hacks/WolframAutomata/WolframAutomata.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hacks/WolframAutomata/WolframAutomata.c b/hacks/WolframAutomata/WolframAutomata.c index e84ba44..65a7e5c 100644 --- a/hacks/WolframAutomata/WolframAutomata.c +++ b/hacks/WolframAutomata/WolframAutomata.c @@ -46,9 +46,9 @@ struct state { uint8_t rule_number; /* At the end of the simulation, the user is given time to admire the */ - /* output. Delay is available to user as CLI option. */ + /* output. Delay is available to user as CLI option '-admiration-delay'. */ Bool admiration_in_progress; - size_t admiration_delay; /* ...in microseconds. */ + size_t admiration_delay; /* ...in seconds. */ /* The following values correspond directly to independent CLI options. */ Bool rule_random; @@ -276,7 +276,7 @@ WolframAutomata_init(Display * dpy, Window win) state->dpy_height = xgwa.height; state->ypos = 0; - state->admiration_delay = 5000000; + state->admiration_delay = get_integer_resource(state->dpy, "admiration-delay", "Integer"); state->admiration_in_progress = False; /* Set foreground and background colors for active/inactive cells. Either */ @@ -482,7 +482,7 @@ WolframAutomata_draw(Display * dpy, Window win, void * closure) closure = WolframAutomata_init(dpy, win); } else { state->admiration_in_progress = True; - return state->admiration_delay; + return 1000000 * state->admiration_delay; } } @@ -503,6 +503,7 @@ WolframAutomata_draw(Display * dpy, Window win, void * closure) static const char * WolframAutomata_defaults[] = { "*delay-usec: 25000", + "*admiration-delay: 5", "*num-generations: 5000", "*pixel-size: 2", "*color-index: -1", @@ -518,6 +519,7 @@ static const char * WolframAutomata_defaults[] = { static XrmOptionDescRec WolframAutomata_options[] = { { "-delay-usec", ".delay-usec", XrmoptionSepArg, 0 }, + { "-admiration-delay", ".admiration-delay", XrmoptionSepArg, 0 }, { "-num-generations", ".num-generations", XrmoptionSepArg, 0 }, { "-pixel-size", ".pixel-size", XrmoptionSepArg, 0 }, { "-color-index", ".color-index", XrmoptionSepArg, 0 }, -- 2.20.1