Cleanup: the `mouse_priorities' field in the back end has been a
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Oct 2005 16:35:23 +0000 (16:35 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 22 Oct 2005 16:35:23 +0000 (16:35 +0000)
more general-purpose flags word for some time now. Rename it to
`flags'.

git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6414 cda61777-01e9-0310-a592-d414129be87e

27 files changed:
blackbox.c
bridges.c
cube.c
devel.but
dominosa.c
fifteen.c
flip.c
guess.c
inertia.c
lightup.c
loopy.c
map.c
midend.c
net.c
netslide.c
nullgame.c
pattern.c
pegs.c
puzzles.h
rect.c
samegame.c
sixteen.c
slant.c
solo.c
tents.c
twiddle.c
untangle.c

index 1889a19..b8c6bc0 100644 (file)
@@ -1434,7 +1434,7 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 /* vim: set shiftwidth=4 tabstop=8: */
index d12c1e4..a6cad87 100644 (file)
--- a/bridges.c
+++ b/bridges.c
@@ -2668,7 +2668,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 /* vim: set shiftwidth=4 tabstop=8: */
diff --git a/cube.c b/cube.c
index 59be960..99d5bb1 100644 (file)
--- a/cube.c
+++ b/cube.c
@@ -1738,5 +1738,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 88ff947..66413ec 100644 (file)
--- a/devel.but
+++ b/devel.but
@@ -1166,8 +1166,7 @@ State changes as a result of a Restart operation are never animated;
 the mid-end will handle them internally and never consult this
 function at all. State changes as a result of Solve operations are
 also not animated by default, although you can change this for a
-particular game by setting a flag in \c{mouse_priorities}
-(\k{backend-mouse-priorities}).
+particular game by setting a flag in \c{flags} (\k{backend-flags}).
 
 The function is also passed a pointer to the local \c{game_ui}. It
 may refer to information in here to help with its decision (see
@@ -1441,12 +1440,12 @@ the game was first completed (by setting a flag in
 freeze the timer thereafter so that the user can undo back through
 their solution process without altering their time.
 
-\S{backend-mouse-priorities} \c{mouse_priorities}
+\S{backend-flags} \c{flags}
 
-\c int mouse_priorities;
+\c int flags;
 
-This field is badly named. It is in fact a generic flags word. It
-consists of the bitwise OR of the following flags:
+This field contains miscellaneous per-backend flags. It consists of
+the bitwise OR of some combination of the following:
 
 \dt \cw{BUTTON_BEATS(x,y)}
 
index f9d55d6..f08cbf6 100644 (file)
@@ -1778,5 +1778,5 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 72c1c12..9519f1a 100644 (file)
--- a/fifteen.c
+++ b/fifteen.c
@@ -883,5 +883,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
diff --git a/flip.c b/flip.c
index bcd2ed0..16f8bc2 100644 (file)
--- a/flip.c
+++ b/flip.c
@@ -1304,5 +1304,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
diff --git a/guess.c b/guess.c
index aa37049..d31d061 100644 (file)
--- a/guess.c
+++ b/guess.c
@@ -1314,7 +1314,7 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 /* vim: set shiftwidth=4 tabstop=8: */
index 6774ca2..055d264 100644 (file)
--- a/inertia.c
+++ b/inertia.c
@@ -2178,5 +2178,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 0d22131..841458a 100644 (file)
--- a/lightup.c
+++ b/lightup.c
@@ -2254,7 +2254,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
diff --git a/loopy.c b/loopy.c
index 7570219..406c72f 100644 (file)
--- a/loopy.c
+++ b/loopy.c
@@ -2753,5 +2753,5 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                       /* mouse_priorities */
+    0,                                /* flags */
 };
diff --git a/map.c b/map.c
index 3b01d9b..5943683 100644 (file)
--- a/map.c
+++ b/map.c
@@ -3123,7 +3123,7 @@ const struct game thegame = {
     TRUE, TRUE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
index 249fb2b..979a3b6 100644 (file)
--- a/midend.c
+++ b/midend.c
@@ -578,7 +578,7 @@ static int midend_really_process_key(midend *me, int x, int y, int button)
      * See if this move requires an animation.
      */
     if (special(type) && !(type == SOLVE &&
-                          (me->ourgame->mouse_priorities & SOLVE_ANIMATES))) {
+                          (me->ourgame->flags & SOLVE_ANIMATES))) {
         anim_time = 0;
     } else {
         anim_time = me->ourgame->anim_length(oldstate,
@@ -690,7 +690,7 @@ int midend_process_key(midend *me, int x, int y, int button)
         * If the new button has lower priority than the old one,
         * don't bother doing this.
         */
-       if (me->ourgame->mouse_priorities &
+       if (me->ourgame->flags &
            BUTTON_BEATS(me->pressed_mouse_button, button))
            return ret;                /* just ignore it */
 
@@ -1214,7 +1214,7 @@ char *midend_solve(midend *me)
                                    me->states[me->statepos-2].state,
                                    me->states[me->statepos-1].state);
     me->dir = +1;
-    if (me->ourgame->mouse_priorities & SOLVE_ANIMATES) {
+    if (me->ourgame->flags & SOLVE_ANIMATES) {
        me->oldstate = me->ourgame->dup_game(me->states[me->statepos-2].state);
         me->anim_time =
            me->ourgame->anim_length(me->states[me->statepos-2].state,
diff --git a/net.c b/net.c
index 3e49b38..82d9ed0 100644 (file)
--- a/net.c
+++ b/net.c
@@ -2873,5 +2873,5 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index c51a1e3..c710e71 100644 (file)
@@ -1827,5 +1827,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 6463bf7..799a8a5 100644 (file)
@@ -289,5 +289,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index dd664f5..f034bd4 100644 (file)
--- a/pattern.c
+++ b/pattern.c
@@ -1281,7 +1281,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
diff --git a/pegs.c b/pegs.c
index e4549db..9b98c70 100644 (file)
--- a/pegs.c
+++ b/pegs.c
@@ -1224,5 +1224,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 659afa6..f4fc67f 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -60,12 +60,14 @@ enum {
 #define IS_MOUSE_RELEASE(m) ( (unsigned)((m) - LEFT_RELEASE) <= \
                                (unsigned)(RIGHT_RELEASE - LEFT_RELEASE))
 
+/*
+ * Flags in the back end's `flags' word.
+ */
 /* Bit flags indicating mouse button priorities */
 #define BUTTON_BEATS(x,y) ( 1 << (((x)-LEFT_BUTTON)*3+(y)-LEFT_BUTTON) )
-
-/* Another random flag that goes in the mouse priorities section for want
- * of a better place to put it */
+/* Flag indicating that Solve operations should be animated */
 #define SOLVE_ANIMATES ( 1 << 9 )
+/* end of `flags' word definitions */
 
 #define IGNOREARG(x) ( (x) = (x) )
 
@@ -397,7 +399,7 @@ struct game {
     int (*wants_statusbar)(void);
     int is_timed;
     int (*timing_state)(game_state *state, game_ui *ui);
-    int mouse_priorities;
+    int flags;
 };
 
 /*
diff --git a/rect.c b/rect.c
index 9b78089..60c8e94 100644 (file)
--- a/rect.c
+++ b/rect.c
@@ -2874,5 +2874,5 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 781cbcc..387216d 100644 (file)
@@ -1664,5 +1664,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index 51771a8..fbed055 100644 (file)
--- a/sixteen.c
+++ b/sixteen.c
@@ -1059,5 +1059,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
diff --git a/slant.c b/slant.c
index c7aa169..ebc5bbb 100644 (file)
--- a/slant.c
+++ b/slant.c
@@ -2089,7 +2089,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
diff --git a/solo.c b/solo.c
index 2079da9..eb8ad80 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -3090,7 +3090,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
diff --git a/tents.c b/tents.c
index 8a555b4..869ba5e 100644 (file)
--- a/tents.c
+++ b/tents.c
@@ -2091,7 +2091,7 @@ const struct game thegame = {
     TRUE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
 
 #ifdef STANDALONE_SOLVER
index 8711ada..b366fd7 100644 (file)
--- a/twiddle.c
+++ b/twiddle.c
@@ -1226,5 +1226,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    0,                                /* mouse_priorities */
+    0,                                /* flags */
 };
index a88e6d8..3d0918a 100644 (file)
@@ -1463,5 +1463,5 @@ const struct game thegame = {
     FALSE, FALSE, game_print_size, game_print,
     game_wants_statusbar,
     FALSE, game_timing_state,
-    SOLVE_ANIMATES,                   /* mouse_priorities */
+    SOLVE_ANIMATES,                   /* flags */
 };