aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2011-04-02 15:36:30 +0000
committerSimon Tatham <anakin@pobox.com>2011-04-02 15:36:30 +0000
commit8c6c8df8f4bd07602931485956fce524925dc2bb (patch)
tree11b2abd4e36e1826f4076351d6a0791aabf2584d /midend.c
parent00a313f2d6d96257fd634c743b609cb5b6465e3c (diff)
downloadpuzzles-8c6c8df8f4bd07602931485956fce524925dc2bb.zip
puzzles-8c6c8df8f4bd07602931485956fce524925dc2bb.tar.gz
puzzles-8c6c8df8f4bd07602931485956fce524925dc2bb.tar.bz2
puzzles-8c6c8df8f4bd07602931485956fce524925dc2bb.tar.xz
Add functions provided by the midend to tell a front end whether GUI
buttons for undo and redo should currently be greyed out. [originally from svn r9139]
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/midend.c b/midend.c
index 05ea663..300e2bf 100644
--- a/midend.c
+++ b/midend.c
@@ -428,6 +428,16 @@ void midend_new_game(midend *me)
me->pressed_mouse_button = 0;
}
+int midend_can_undo(midend *me)
+{
+ return (me->statepos > 1);
+}
+
+int midend_can_redo(midend *me)
+{
+ return (me->statepos < me->nstates);
+}
+
static int midend_undo(midend *me)
{
if (me->statepos > 1) {