ui/cocoa/text.h

changeset 13
2dbc56c2323b
parent 7
431dde3c5fbe
child 23
decc6bf584aa
equal deleted inserted replaced
12:fe94e0fb9ef3 13:2dbc56c2323b
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #import "../ui/text.h" 29 #import "../ui/text.h"
30 #import "toolkit.h" 30 #import "toolkit.h"
31 #import "../../ucx/list.h"
32
33 @interface TextChangeMgr : NSObject<NSTextViewDelegate> {
34 UiText* value;
35 }
36
37 - (TextChangeMgr*)initWithValue:(UiText*)text;
38
39 - (NSUndoManager*)undoManagerForTextView:(NSTextView*)textview;
40
41 @end
42
43 #define UI_TEXTBUF_INSERT 0
44 #define UI_TEXTBUF_DELETE 1
45 typedef struct UiTextBufOp {
46 int type; // UI_TEXTBUF_INSERT, UI_TEXTBUF_DELETE
47 int start;
48 int end;
49 int len;
50 char *text;
51 } UiTextBufOp;
52
53
31 54
32 char* ui_textarea_get(UiText *text); 55 char* ui_textarea_get(UiText *text);
33 void ui_textarea_set(UiText *text, char *str); 56 void ui_textarea_set(UiText *text, char *str);
57 char* ui_textarea_getsubstr(UiText *text, int begin, int end);
58 void ui_textarea_insert(UiText *text, int pos, char *str);

mercurial