Updated WolframAutomata's admiration window related flags to match README.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 9 Jun 2021 02:19:20 +0000 (19:19 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Wed, 9 Jun 2021 02:19:20 +0000 (19:19 -0700)
hacks/WolframAutomata/WolframAutomata.c

index e84ba44..65a7e5c 100644 (file)
@@ -46,9 +46,9 @@ struct state {
     uint8_t rule_number;
 
     /* At the end of the simulation, the user is given time to admire the     */
     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;
     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;
 
     /* 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->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 */
     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;
             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",
 
 static const char * WolframAutomata_defaults[] = {
     "*delay-usec:         25000",
+    "*admiration-delay:   5",
     "*num-generations:    5000",
     "*pixel-size:         2",
     "*color-index:        -1",
     "*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      },
 
 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      },
     { "-num-generations",    ".num-generations",        XrmoptionSepArg, 0      },
     { "-pixel-size",         ".pixel-size",             XrmoptionSepArg, 0      },
     { "-color-index",        ".color-index",            XrmoptionSepArg, 0      },