chiark / gitweb /
Forbid undo of new-game if it would change the params.
[sgt-puzzles.git] / puzzles.h
index 03af2ca18671183233049537b9384022796476e0..47c164c163b6fc6220a6a5f0fbf8eb06de7b05ed 100644 (file)
--- a/puzzles.h
+++ b/puzzles.h
@@ -47,6 +47,15 @@ enum {
     CURSOR_RIGHT,
     CURSOR_SELECT,
     CURSOR_SELECT2,
+    /* UI_* are special keystrokes generated by front ends in response
+     * to menu actions, never passed to back ends */
+    UI_LOWER_BOUND,
+    UI_QUIT,
+    UI_NEWGAME,
+    UI_SOLVE,
+    UI_UNDO,
+    UI_REDO,
+    UI_UPPER_BOUND,
     
     /* made smaller because of 'limited range of datatype' errors. */
     MOD_CTRL       = 0x1000,
@@ -64,6 +73,7 @@ enum {
 #define IS_CURSOR_MOVE(m) ( (m) == CURSOR_UP || (m) == CURSOR_DOWN || \
                             (m) == CURSOR_RIGHT || (m) == CURSOR_LEFT )
 #define IS_CURSOR_SELECT(m) ( (m) == CURSOR_SELECT || (m) == CURSOR_SELECT2)
+#define IS_UI_FAKE_KEY(m) ( (m) > UI_LOWER_BOUND && (m) < UI_UPPER_BOUND )
 
 /*
  * Flags in the back end's `flags' word.