diff -r 809581724cc7 -r 0358f1d9c506 ui/gtk/text.h --- a/ui/gtk/text.h Sat Apr 15 21:06:45 2023 +0200 +++ b/ui/gtk/text.h Mon May 22 16:17:26 2023 +0200 @@ -31,7 +31,7 @@ #include "../ui/text.h" #include "toolkit.h" -#include +#include #include "../common/context.h" #ifdef __cplusplus @@ -40,19 +40,24 @@ #define UI_TEXTBUF_INSERT 0 #define UI_TEXTBUF_DELETE 1 -typedef struct UiTextBufOp { + +typedef struct UiTextBufOp UiTextBufOp; +struct UiTextBufOp { + UiTextBufOp *prev; + UiTextBufOp *next; int type; // UI_TEXTBUF_INSERT, UI_TEXTBUF_DELETE int start; int end; int len; char *text; -} UiTextBufOp; +}; typedef struct UiUndoMgr { - UcxList *begin; - UcxList *cur; - int length; - int event; + UiTextBufOp *begin; + UiTextBufOp *end; + UiTextBufOp *cur; + int length; + int event; } UiUndoMgr; typedef struct UiTextArea { @@ -95,6 +100,7 @@ GtkTextIter *end, void *data); UiUndoMgr* ui_create_undomgr(); +void ui_destroy_undomgr(UiUndoMgr *mgr); void ui_free_textbuf_op(UiTextBufOp *op); int ui_check_insertstr(char *oldstr, int oldlen, char *newstr, int newlen);