ui/gtk/text.h

branch
newapi
changeset 178
7c3ff86ee9d4
parent 174
0358f1d9c506
child 253
087cc9216f28
--- a/ui/gtk/text.h	Sun Apr 16 10:20:21 2023 +0200
+++ b/ui/gtk/text.h	Tue May 23 11:11:28 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