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]
This commit is contained in:
Simon Tatham
2011-04-02 15:36:30 +00:00
parent 00a313f2d6
commit 8c6c8df8f4
3 changed files with 30 additions and 0 deletions

View File

@ -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) {