chiark / gitweb /
Cleanup: the `mouse_priorities' field in the back end has been a
authorSimon Tatham <anakin@pobox.com>
Sat, 22 Oct 2005 16:35:23 +0000 (16:35 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 22 Oct 2005 16:35:23 +0000 (16:35 +0000)
more general-purpose flags word for some time now. Rename it to
`flags'.

[originally from svn r6414]

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 1889a19f1e66614159fee2137f37298dd45e98fd..b8c6bc045a0cff6444a83c0ba5d52564d5b0eaa0 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 d12c1e46e0522c4f331a18d0c30712ecd894d6b5..a6cad8752609c4e18cb89653d2d8bc1e8a99b049 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 59be9600f31189ed604a7ff800898824b6735ea1..99d5bb1479544cb1976eb09ac284fff1d46f9264 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 88ff9470d20b62e267a54e30da9d1cce2c0fd5ee..66413ecbbfee6f4bf19ed648673ec5b6de42f392 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 f9d55d6658c62cd7526b7d328d6e823ac7465107..f08cbf6e5c7a66e1bc85e58d1c91893f2781a73f 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 72c1c127d03002be3caf0f29aa96aaa8a4985e8c..9519f1aa5e5b4c6b58dad6ccafe04de44802267e 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 bcd2ed0779d1b1f096d7e0e9080e1fb2d818b537..16f8bc283725f6e17f50fd1801c998073d083721 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 aa3704991c517a5cbc846a2d4026d8326ced27ab..d31d0613f723b70f192896fc6214cf1599b30b69 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 6774ca2abae59373fbbbfacb1f3855d2ff7bef88..055d264252b66b4b7feeb021ba98bd792912d9fe 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 0d22131a3d6d7e31fb2b807dd0ca68fc4aae8136..841458ad05f375a02156f0a3410862b3fb8ece77 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 75702190f47126943fdf00f37f3a42d4e3ae83c2..406c72fb6cb48999b6a5f6e82f7d4a55357ea79e 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 3b01d9b855652277c41c350c493c4fb6163a8caa..5943683905e7f543f5fe7fe0ada976494de54fd4 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 249fb2bc7238b4a98a69999e3e39471b105b1244..979a3b640ac6ec9931014949aeb34cf5324d89cf 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 3e49b38651e7213c2815966ef7a33c908d9e1717..82d9ed0b53256732f4fb59deeb93b5695ef515ca 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 c51a1e3b5560f765aabc8b4fcc675647369e653c..c710e71bf9a65d4784b9dd35340e4486f5c60d11 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 6463bf7ac44df5971e81a2c94f3895f05b25214b..799a8a5e70a64b8ebd62c86d025af0fc4502d24f 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 dd664f561d1b704eb8e32284aaf3f5b5b597bbb0..f034bd41504d86fbb493ce4229023d23a220a2d2 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 e4549db54778995e3238030eb3fb9b0cd7cb99c0..9b98c700fd93b561e66616ecb5f262c8b5b02e0d 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 659afa6ab0068dfd6b2c3aa9bec58624f7d3cddd..f4fc67f3cbf6b6fc38ce43e1ef89f12212d06865 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 9b780891f647090d5271100479a441d5079840d3..60c8e943df35a74d56fa59442bbe45617ee8bcb3 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 781cbcc07c0b0f69ed083b58f4d514fd189de374..387216d1407bbf01cae2618d9eae7a0f4c2a8338 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 51771a80374adc675a0f62798b219dad8c48d477..fbed0554d60f20f6d5e2cd85699d997c99fa35e0 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 c7aa1695c014e8c6f3eb4130a583171a870f0e75..ebc5bbb6d65be95d0f244fe1dd3de6005c109b8e 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 2079da952fa0d4a26bc1aeea8bb9de137ffc91e7..eb8ad8042fdccc0fc4ab5e91e7d16fbbbe7c7cdf 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 8a555b4bca619bdbe5b163a7a1f77ea932759c89..869ba5e314ed02f7051794ea5fbdf7bb9e79c119 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 8711ada2f6b7f54c8bde928fbfca01ac4901a6c7..b366fd7c1378b5710aca6db4e6f46cfc3adaa392 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 a88e6d81410ef9f58536550bd63719df83760bd3..3d0918aa3a3e18dfcdec7c072d4bb0370ed652b0 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 */
 };