diff -r 84a541c6e093 -r e70e855cea89 ui/motif/text.h --- a/ui/motif/text.h Wed Mar 26 15:53:43 2014 +0100 +++ b/ui/motif/text.h Wed Mar 26 22:02:57 2014 +0100 @@ -31,14 +31,36 @@ #include "../ui/text.h" #include "toolkit.h" +#include "../../ucx/list.h" #ifdef __cplusplus extern "C" { #endif +#define UI_TEXTBUF_INSERT 0 +#define UI_TEXTBUF_DELETE 1 +typedef struct UiTextBufOp { + 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; +} UiUndoMgr; + char* ui_textarea_get(UiText *text); void ui_textarea_set(UiText *text, char *str); +UiUndoMgr* ui_create_undomgr(); +void ui_text_modify_callback(Widget widget, UiText *value, XtPointer data); +int ui_check_insertstr(char *oldstr, int oldlen, char *newstr, int newlen); +void ui_free_textbuf_op(UiTextBufOp *op); #ifdef __cplusplus }