ui/gtk/text.h

branch
newapi
changeset 174
0358f1d9c506
parent 163
b70e2a77dea0
child 253
087cc9216f28
--- 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 <ucx/list.h>
+#include <cx/linked_list.h>
 #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);
 

mercurial