summaryrefslogtreecommitdiffstats
path: root/generic/tkUndo.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-07-21 20:06:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-07-21 20:06:34 (GMT)
commita80e603c517d2682ef25067ac6daf1d2692d5864 (patch)
treecd7aaee28e7876e8bfdd77e835c534b13cbe5f98 /generic/tkUndo.c
parent682d30ed7f59d3c732d08cf6ccc715e738784453 (diff)
parent2aa945d6a8109c74d9ff3331fb99a093635e0cd7 (diff)
downloadtk-a80e603c517d2682ef25067ac6daf1d2692d5864.zip
tk-a80e603c517d2682ef25067ac6daf1d2692d5864.tar.gz
tk-a80e603c517d2682ef25067ac6daf1d2692d5864.tar.bz2
Diffstat (limited to 'generic/tkUndo.c')
-rw-r--r--generic/tkUndo.c52
1 files changed, 49 insertions, 3 deletions
diff --git a/generic/tkUndo.c b/generic/tkUndo.c
index 8359e0a..c66905d 100644
--- a/generic/tkUndo.c
+++ b/generic/tkUndo.c
@@ -353,7 +353,7 @@ TkUndoInitStack(
/*
*----------------------------------------------------------------------
*
- * TkUndoSetDepth --
+ * TkUndoSetMaxDepth --
*
* Set the maximum depth of stack.
*
@@ -368,7 +368,7 @@ TkUndoInitStack(
*/
void
-TkUndoSetDepth(
+TkUndoSetMaxDepth(
TkUndoRedoStack *stack, /* An Undo/Redo stack */
int maxdepth) /* The maximum stack depth */
{
@@ -478,6 +478,52 @@ TkUndoFreeStack(
/*
*----------------------------------------------------------------------
*
+ * TkUndoCanRedo --
+ *
+ * Returns true if redo is possible, i.e. if the redo stack is not empty.
+ *
+ * Results:
+ * A boolean.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkUndoCanRedo(
+ TkUndoRedoStack *stack) /* An Undo/Redo stack */
+{
+ return stack->redoStack != NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TkUndoCanUndo --
+ *
+ * Returns true if undo is possible, i.e. if the undo stack is not empty.
+ *
+ * Results:
+ * A boolean.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TkUndoCanUndo(
+ TkUndoRedoStack *stack) /* An Undo/Redo stack */
+{
+ return stack->undoStack != NULL;
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
* TkUndoInsertUndoSeparator --
*
* Insert a separator on the undo stack, indicating a border for an
@@ -498,7 +544,7 @@ TkUndoInsertUndoSeparator(
{
if (TkUndoInsertSeparator(&stack->undoStack)) {
stack->depth++;
- TkUndoSetDepth(stack, stack->maxdepth);
+ TkUndoSetMaxDepth(stack, stack->maxdepth);
}
}