summaryrefslogtreecommitdiff
path: root/gramscii.h
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-07-31 00:10:35 +0100
committerKatolaZ <katolaz@freaknet.org>2019-07-31 00:10:35 +0100
commit526ce3a130732d4a2374a6e36a689d9e0cf5cc34 (patch)
tree9b6f76dbc70bf9a4d2becb9b9d8103eb57663aa0 /gramscii.h
parent6da2f3f89afda08eeba385da1c36414154113d47 (diff)
preliminary support for undo
Diffstat (limited to 'gramscii.h')
-rw-r--r--gramscii.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/gramscii.h b/gramscii.h
index a08d211..73b9db7 100644
--- a/gramscii.h
+++ b/gramscii.h
@@ -44,6 +44,9 @@
#define VIDEO_NRM 0
#define VIDEO_REV 7
+#define CUR 0x01
+#define LST 0x02
+
/** types **/
typedef struct{
@@ -59,6 +62,7 @@ typedef struct{
line_t *l;
} lineset_t;
+
/** MACROS **/
#define MIN(x,y) (x) < (y) ? (x) : (y)
@@ -73,6 +77,11 @@ typedef struct{
lineset_t screen;
lineset_t cutbuf;
+lineset_t *undo;
+
+int undo_sz;
+int undo_cur;
+int undo_lst;
int WIDTH, HEIGHT;
@@ -155,6 +164,8 @@ void ensure_line_length(line_t *l, int len);
void ensure_num_lines(lineset_t *ls, int n);
void yank_region(int x1, int y1, int x2, int y2);
void paste_region(int x1, int y1);
-
+void copy_lines_to_ring(int y1, int y2, int which);
+void undo_change();
+void redo_change();
#endif