diff -r 2cb06c231057 -r bc63cb601f6d ui/motif/text.h --- a/ui/motif/text.h Mon May 22 19:44:27 2023 +0200 +++ b/ui/motif/text.h Mon May 22 21:21:20 2023 +0200 @@ -31,7 +31,7 @@ #include "../ui/text.h" #include "toolkit.h" -#include +#include #ifdef __cplusplus extern "C" { @@ -39,19 +39,23 @@ #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 { @@ -69,6 +73,7 @@ int ui_textarea_length(UiText *text); UiUndoMgr* ui_create_undomgr(); +void ui_destroy_undomgr(UiUndoMgr *mgr); void ui_text_selection_callback( Widget widget, UiTextArea *textarea,