diff -r fe94e0fb9ef3 -r 2dbc56c2323b ui/cocoa/text.h --- a/ui/cocoa/text.h Sat Mar 29 12:15:39 2014 +0100 +++ b/ui/cocoa/text.h Sat Mar 29 19:12:07 2014 +0100 @@ -28,6 +28,31 @@ #import "../ui/text.h" #import "toolkit.h" +#import "../../ucx/list.h" + +@interface TextChangeMgr : NSObject { + UiText* value; +} + +- (TextChangeMgr*)initWithValue:(UiText*)text; + +- (NSUndoManager*)undoManagerForTextView:(NSTextView*)textview; + +@end + +#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; + + char* ui_textarea_get(UiText *text); void ui_textarea_set(UiText *text, char *str); +char* ui_textarea_getsubstr(UiText *text, int begin, int end); +void ui_textarea_insert(UiText *text, int pos, char *str);