29 #ifndef TEXT_H |
29 #ifndef TEXT_H |
30 #define TEXT_H |
30 #define TEXT_H |
31 |
31 |
32 #include "../ui/text.h" |
32 #include "../ui/text.h" |
33 #include "toolkit.h" |
33 #include "toolkit.h" |
|
34 #include "../../ucx/list.h" |
34 |
35 |
35 #ifdef __cplusplus |
36 #ifdef __cplusplus |
36 extern "C" { |
37 extern "C" { |
37 #endif |
38 #endif |
|
39 |
|
40 #define UI_TEXTBUF_INSERT 0 |
|
41 #define UI_TEXTBUF_DELETE 1 |
|
42 typedef struct UiTextBufOp { |
|
43 int type; // UI_TEXTBUF_INSERT, UI_TEXTBUF_DELETE |
|
44 int start; |
|
45 int end; |
|
46 int len; |
|
47 char *text; |
|
48 } UiTextBufOp; |
|
49 |
|
50 typedef struct UiUndoMgr { |
|
51 UcxList *begin; |
|
52 UcxList *cur; |
|
53 int length; |
|
54 int event; |
|
55 } UiUndoMgr; |
38 |
56 |
39 char* ui_textarea_get(UiText *text); |
57 char* ui_textarea_get(UiText *text); |
40 void ui_textarea_set(UiText *text, char *str); |
58 void ui_textarea_set(UiText *text, char *str); |
41 void ui_textarea_realize_event(GtkWidget *widget, gpointer data); |
59 void ui_textarea_realize_event(GtkWidget *widget, gpointer data); |
42 void ui_textbuf_insert( |
60 void ui_textbuf_insert( |